auser-poolparty 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. data/VERSION.yml +1 -1
  2. data/bin/cloud-show +27 -0
  3. data/lib/poolparty/base_packages/haproxy.rb +4 -3
  4. data/lib/poolparty/dependency_resolver/chef_resolver.rb +14 -2
  5. data/lib/poolparty/helpers/binary.rb +8 -7
  6. data/lib/poolparty/lite.rb +1 -1
  7. data/lib/poolparty/monitors/base_monitor.rb +81 -81
  8. data/lib/poolparty/monitors/monitor_rack.rb +8 -1
  9. data/lib/poolparty/monitors/stats_monitor.rb +11 -12
  10. data/lib/poolparty/poolparty/cloud.rb +22 -136
  11. data/lib/poolparty/poolparty/template.rb +10 -1
  12. data/lib/poolparty/provision/boot_strapper.rb +2 -1
  13. data/lib/poolparty/resources/file.rb +4 -4
  14. data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +1 -1
  15. data/spec/poolparty/net/remote_spec.rb +0 -1
  16. data/spec/poolparty/poolparty/cloud_spec.rb +2 -36
  17. data/spec/poolparty/resources/file_spec.rb +1 -0
  18. data/test/fixtures/test_template.erb +1 -0
  19. data/test/poolparty/poolparty/template_test.rb +31 -0
  20. data/test/poolparty/provision/boot_strapper_test.rb +6 -0
  21. data/test/poolparty/provision/dr_configure_test.rb +6 -0
  22. data/test/test_helper.rb +2 -0
  23. metadata +12 -17
  24. data/lib/poolparty/provisioners/capistrano/capistrano.rb +0 -158
  25. data/lib/poolparty/provisioners/capistrano/capistrano_configurer.rb +0 -69
  26. data/lib/poolparty/provisioners/capistrano/recipes/aws.rb +0 -21
  27. data/lib/poolparty/provisioners/capistrano/recipes/base.rb +0 -164
  28. data/lib/poolparty/provisioners/capistrano/recipes/master.rb +0 -66
  29. data/lib/poolparty/provisioners/capistrano/recipes/puppet.rb +0 -101
  30. data/lib/poolparty/provisioners/capistrano/recipes/slave.rb +0 -36
  31. data/lib/poolparty/provisioners/provisioner_base.rb +0 -222
  32. data/spec/poolparty/provisioners/capistrano/capistrano_spec.rb +0 -40
  33. data/spec/poolparty/provisioners/provisioner_base_spec.rb +0 -129
@@ -1,66 +0,0 @@
1
- # Cloud tasks
2
- # Run each of these methods inside the Capistrano:Configuration context, dynamicly adding each method as a capistrano task.
3
- Capistrano::Configuration.instance(:must_exist).load do
4
- # namespace(:master) do
5
- desc "Provision master"
6
- def master_provision_master_task
7
- upgrade_system
8
- set_hostname_to_master
9
- create_local_hosts_entry
10
- setup_for_poolparty
11
- install_provisioner
12
- setup_basic_poolparty_structure
13
- setup_provisioner_filestore
14
- setup_provisioner_autosigning
15
- # install_rubygems
16
- install_ruby_from_stable_source
17
- install_rubygems_from_stable_source
18
-
19
- # fix_rubygems
20
- add_provisioner_configs
21
- setup_provisioner_config
22
- put_aws_credintials_on_server if using_remoter? == 'ec2'
23
- create_puppetrunner_command
24
- # download_base_gems
25
- unpack_dependencies_store
26
- install_base_gems
27
- # copy_gem_bins_to_usr_bin
28
- # install_poolparty_from_github
29
- write_erlang_cookie
30
- vputs "master_provision_master_task complete"
31
- end
32
-
33
- desc "Configure master"
34
- def master_configure_master_task
35
- create_local_node_entry_for_puppet
36
- put_provisioner_manifest_on_server
37
- start_provisioner_base
38
- # move_template_files
39
- ensure_provisioner_is_running
40
- run_provisioner
41
- end
42
-
43
- desc "Set hostname to master"
44
- def set_hostname_to_master
45
- run "hostname master"
46
- end
47
-
48
- desc "Add host entry into the master instance"
49
- def create_local_hosts_entry
50
- run "if [ -z \"$(grep -v '#' /etc/hosts | grep 'puppet')\" ]; then echo '#{cloud.master.ip} master puppet localhost' >> /etc/hosts; fi"
51
- end
52
-
53
- desc "Download base gems"
54
- def download_base_gems
55
- run(returning(Array.new) do |arr|
56
- base_gems.each do |name, url|
57
- if url && !url.empty?
58
- arr << "curl -L -o #{Default.remote_storage_path}/#{name}.gem #{url} 2>&1; echo 'downloaded #{name}'"
59
- arr << "if test -s #{Default.remote_storage_path}/#{name}.gem; then echo ''; else rm #{Default.remote_storage_path}/#{name}.gem; fi; echo ''"
60
- end
61
- end
62
- end.join(" && "))
63
- end
64
-
65
- # end
66
- end
@@ -1,101 +0,0 @@
1
- Capistrano::Configuration.instance(:must_exist).load do
2
-
3
- desc "Start provisioner base"
4
- def start_provisioner_base
5
- # run "/etc/init.d/puppetmaster start"
6
- run "/usr/bin/puppetrunner"
7
- end
8
-
9
- desc "Restart provisioner base"
10
- def restart_provisioner_base #FIXME: should inherit from cloud dependency_resolver_command
11
- "/usr/bin/puppetrunner"
12
- # run "/etc/init.d/puppetmaster stop;rm -rf /etc/poolparty/ssl;start_provisioner_based --verbose;/etc/init.d/puppetmaster start"
13
- end
14
-
15
- desc "Ensure provisioner is running"
16
- def ensure_provisioner_is_running
17
- "/usr/bin/puppetrunner"
18
- # run "/usr/sbin/puppetmasterd --verbose 2>1 > /dev/null;echo ''"
19
- end
20
-
21
- desc "Create local node for puppet manifest"
22
- def create_local_node_entry_for_puppet
23
- # run ". /etc/profile && server-write-new-nodes"
24
- str = ["node default { include poolparty }"]
25
- list_of_running_instances.each do |ri|
26
- str << "node \"#{ri.name}\" inherits default {}\n"
27
- end
28
- put( str.join("\n"), "#{manifest_path}/nodes/nodes.pp")
29
- end
30
-
31
- #DEPRECATED
32
- # desc "Move template files into place"
33
- # def move_template_files
34
- # run <<-EOR
35
- # mkdir -p #{template_path} &&
36
- # cp -R #{remote_storage_path}/templates/* #{template_path}
37
- # EOR
38
- # end
39
-
40
- desc "put manifest into place"
41
- def put_provisioner_manifest_on_server
42
- put build_manifest, '/etc/puppet/manifests/classes/poolparty.pp'
43
- end
44
-
45
- desc "Create poolparty runner command"
46
- def create_puppetrunner_command
47
- run 'mkdir -p /root/log'
48
- put(::File.read(::File.dirname(__FILE__)+'/../../../templates/puppetrunner'), '/usr/bin/puppetrunner', :mode=>755)
49
- end
50
-
51
- desc "Create poolparty rerun command"
52
- def create_puppetrerun_command
53
- run <<-EOR
54
- cp #{remote_storage_path}/templates/puppetrerun /usr/bin/puppetrerun &&
55
- chmod +x /usr/bin/puppetrerun
56
- EOR
57
- end
58
-
59
- desc "Add the proper configs for provisioner"
60
- def add_provisioner_configs
61
- run "cp #{remote_storage_path}/namespaceauth.conf /etc/puppet/namespaceauth.conf"
62
- end
63
-
64
- desc "Setup config file for provisioner"
65
- def setup_provisioner_config
66
- run "mv #{remote_storage_path}/puppet.conf /etc/puppet/puppet.conf"
67
- end
68
-
69
- desc "Run the provisioner twice (usually on install)"
70
- def run_provisioner_twice
71
- # run "/usr/sbin/puppetd --test --server master 2>1 > /dev/null && /usr/sbin/puppetd --onetime --daemonize --logdest syslog --server master"
72
- run "/usr/bin/puppetrunner"
73
- end
74
-
75
- desc "Run the provisioner"
76
- def run_provisioner
77
- # run "/usr/sbin/puppetd --onetime --daemonize --logdest syslog --server master"
78
- run "/usr/bin/puppetrunner"
79
- end
80
-
81
- desc "Rerun the provisioner"
82
- def rerun_provisioner
83
- run "/usr/bin/puppetrunner"
84
- end
85
-
86
- desc "Remove the certs"
87
- def remove_certs
88
- run "rm -rf /etc/puppet/ssl"
89
- end
90
-
91
- desc "Update rubygems"
92
- def update_rubygems
93
- run "/usr/bin/gem update --system 2>1 > /dev/null;/usr/bin/gem update --system;echo 'gems updated'"
94
- end
95
-
96
- desc "Stop provisioner daemon"
97
- def stop_provisioner_daemon
98
- run "/etc/init.d/puppetmaster stop"
99
- end
100
-
101
- end
@@ -1,36 +0,0 @@
1
- Capistrano::Configuration.instance(:must_exist).load do
2
- # namespace(:slave) do
3
- desc "Provision a slave"
4
- def slave_provision_slave_task
5
- upgrade_system
6
- add_master_to_hosts_file
7
- setup_for_poolparty
8
- install_provisioner
9
- stop_provisioner_daemon
10
- setup_basic_poolparty_structure
11
- setup_provisioner_filestore
12
- setup_provisioner_autosigning
13
- install_rubygems
14
- fix_rubygems
15
- add_provisioner_configs
16
- setup_provisioner_config
17
- create_puppetrunner_command
18
- # create_puppetrerun_command
19
- download_base_gems
20
- install_base_gems
21
- copy_gem_bins_to_usr_bin
22
- write_erlang_cookie
23
- end
24
- desc "Configure a slave"
25
- def slave_configure_slave_task
26
- create_local_node_entry_for_puppet
27
- put_provisioner_manifest
28
- move_template_files
29
- run_provisioner
30
- end
31
- desc "Add master ip to hosts file"
32
- def add_master_to_hosts_file
33
- run "if [ -z \"$(grep -v '#' /etc/hosts | grep 'master' | grep '#{cloud.master.ip}' )\" ]; then echo '#{cloud.master.ip} puppet master' >> /etc/hosts; else echo 'host already set'; fi"
34
- end
35
- # end
36
- end
@@ -1,222 +0,0 @@
1
- =begin rdoc
2
- The Provisioner is responsible for provisioning REMOTE servers
3
- This class only comes in to play when calling the setup commands on
4
- the development machine
5
- =end
6
- require "capistrano"
7
- require 'capistrano/cli'
8
-
9
- module PoolParty
10
- module Provisioner
11
-
12
- def provisioner_for(inst, caller=self)
13
- PoolParty::Provisioner::Capistrano.new(inst, caller, :ubuntu)
14
- end
15
-
16
- class ProvisionerBase
17
- attr_accessor :config, :loaded_tasks, :instance, :cloud, :os
18
-
19
- include Dslify
20
- include CloudResourcer
21
- include FileWriter
22
-
23
- def initialize(instance=nil, cld=nil, os=:ubuntu, &block)
24
- @instance = instance
25
- @cloud = cld
26
- options(cloud.options) if cloud && cloud.respond_to?(:options)
27
-
28
- dputs "Using key at: #{cld.keypair}"
29
-
30
- @os = os.to_s.downcase.to_sym
31
- self.instance_eval &block if block
32
-
33
- loaded
34
-
35
- # PoolPartyBootStrapper.new(options).execute!
36
- end
37
-
38
- # deprecate
39
- def provision_master?
40
- !@instance.nil? && @instance.master?
41
- end
42
-
43
- def roles_to_provision
44
- [:master] #always provision the master role for now. When do we ever want anything else? MF
45
- end
46
-
47
- # Callback after initialized
48
- def loaded
49
- end
50
-
51
- def loaded_tasks
52
- @loaded_tasks ||= []
53
- end
54
-
55
- ### Installation tasks
56
-
57
- # This is the actual runner for the installation
58
- def install(testing=false)
59
- error unless valid?
60
- setup_runner
61
- unless testing
62
- before_install(@instance)
63
-
64
- vputs "Provisioning #{@instance}"
65
- process_install!(testing)
66
-
67
- after_install(@instance)
68
- end
69
- end
70
- # The provisioner bases overwrite this method
71
- def process_install!(testing=false)
72
- # raise ProvisionerException(" process_install! should be overwritten by provioner, but it was not.") #MF todo
73
- end
74
-
75
- # Configuration
76
- def configure(testing=false)
77
- error unless valid?
78
- setup_runner
79
- unless testing
80
- before_configure(@instance)
81
-
82
- vputs "Provisioning #{@instance.name}"
83
- process_configure!(testing)
84
-
85
- after_configure(@instance)
86
- end
87
- end
88
-
89
- # Tasks that need to be performed everytime we do any
90
- # remote ssh'ing into any instance
91
- def setup_runner(force=false)
92
- @cloud.prepare_for_configuration
93
- @cloud.build_and_store_new_config_file(force)
94
- Neighborhoods.clump(@cloud.remote_instances_list, "#{Default.tmp_path}/neighborhood.json") unless testing
95
- end
96
-
97
- # Callbacks
98
- # Before installation callback
99
- def before_install(instance)
100
- end
101
- def after_install(instance)
102
- end
103
- def before_configure(instance)
104
- end
105
- def after_configure(instance)
106
- end
107
-
108
- def valid?
109
- true
110
- end
111
- def error
112
- raise ProvisionerException.new("Error in installation")
113
- end
114
- # Custom installation tasks
115
- # Allow the remoter bases to attach their own tasks on the
116
- # installation process
117
- def custom_install_tasks
118
- @cloud.custom_install_tasks_for(@instance) || []
119
- end
120
- # Custom configure tasks
121
- # Allows the remoter bases to attach their own
122
- # custom configuration tasks to the configuration process
123
- def custom_configure_tasks
124
- @cloud.custom_configure_tasks_for(@instance) || []
125
- end
126
-
127
- # Last install tasks, if need to install after everything else
128
- def after_install_tasks
129
- @cloud.after_install_tasks_for(@instance)
130
- end
131
-
132
- # Get the packages associated with each os
133
- def puppet_packages
134
- case @os
135
- when :fedora
136
- "puppet-server puppet factor"
137
- else
138
- "puppet puppetmaster"
139
- end
140
- end
141
- # Package installers for general *nix operating systems
142
- def self.installers
143
- @installers ||= {
144
- :ubuntu => "aptitude install -y",
145
- :fedora => "yum install",
146
- :gentoo => "emerge"
147
- }
148
- end
149
- def os_installer
150
- "#{self.class.installers[@os]}"
151
- end
152
- # Convenience method to grab the installer
153
- def installer_for(names=[])
154
- packages = names.is_a?(Array) ? names.join(" ") : names
155
- "#{self.class.installers[@os]} #{packages}"
156
- end
157
-
158
- #TODO#
159
- # Abstract the gems out
160
- def base_gems
161
- {
162
- :logging => "http://rubyforge.org/frs/download.php/44731/logging-0.9.4.gem",
163
- :ZenTest => "http://rubyforge.org/frs/download.php/45581/ZenTest-3.11.0.gem",
164
- :ParseTree => "http://rubyforge.org/frs/download.php/45600/ParseTree-3.0.1.gem",
165
- :ruby2ruby => "http://rubyforge.org/frs/download.php/45587/ruby2ruby-1.2.0.gem",
166
- :activesupport => "http://rubyforge.org/frs/download.php/45627/activesupport-2.1.2.gem",
167
- :"xml-simple" => "http://rubyforge.org/frs/download.php/18366/xml-simple-1.0.11.gem",
168
- :RubyInline => "http://rubyforge.org/frs/download.php/45683/RubyInline-3.8.1.gem",
169
- :flexmock => "http://rubyforge.org/frs/download.php/42580/flexmock-0.8.3.gem",
170
- :lockfile => "http://rubyforge.org/frs/download.php/18698/lockfile-1.4.3.gem",
171
- :rake => "http://rubyforge.org/frs/download.php/43954/rake-0.8.3.gem",
172
- :sexp_processor => "http://rubyforge.org/frs/download.php/45589/sexp_processor-3.0.0.gem",
173
- "net-ssh" => "http://rubyforge.org/frs/download.php/51288/net-ssh-2.0.10.gem",
174
- "net-sftp" => "http://rubyforge.org/frs/download.php/37669/net-sftp-2.0.1.gem",
175
- "net-scp" => "http://rubyforge.org/frs/download.php/37664/net-scp-1.0.1.gem",
176
- "net-ssh-gateway" => "http://rubyforge.org/frs/download.php/36389/net-ssh-gateway-1.0.0.gem",
177
- :echoe => "http://rubyforge.org/frs/download.php/51240/echoe-3.1.gem",
178
- :highline => "http://rubyforge.org/frs/download.php/46328/highline-1.5.0.gem",
179
- :capistrano => "http://rubyforge.org/frs/download.php/51294/capistrano-2.5.4.gem",
180
- :poolparty => "http://github.com/auser/poolparty/tree/master%2Fpkg%2Fpoolparty.gem?raw=true",
181
- "ec2" => "http://rubyforge.org/frs/download.php/43666/amazon-ec2-0.3.1.gem"
182
- }
183
- end
184
-
185
- def download_base_gems_string
186
- returning(Array.new) do |arr|
187
- base_gems.each do |name, url|
188
- arr << "wget #{url} -O #{Default.remote_storage_path}/#{name}.gem 2>&1"
189
- end
190
- end.join(" && ")
191
- end
192
-
193
- def install_base_gems_string
194
- returning(Array.new) do |arr|
195
- base_gems.each do |name, url|
196
- arr << "/usr/bin/gem install --ignore-dependencies --no-ri --no-rdoc #{Default.remote_storage_path}/#{name}.gem"
197
- end
198
- end.join(" && ")
199
- end
200
-
201
- # Template directory from the provisioner base
202
- def template_directory
203
- File.join(File.dirname(__FILE__), "..", "templates")
204
- end
205
-
206
- # Install from the class-level
207
- def self.install(instance, cl=self, testing=false)
208
- new(instance, cl).install(testing)
209
- end
210
-
211
- def self.configure(instance, cl=self, testing=false)
212
- new(instance, cl).configure(testing)
213
- end
214
-
215
- end
216
- end
217
- end
218
-
219
- ## Load the provisioners
220
- Dir[File.dirname(__FILE__) + "/*/*.rb"].each do |file|
221
- require file
222
- end
@@ -1,40 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
-
3
- describe "Capistrano provisioner" do
4
- before(:each) do
5
- @cloud = new_test_cloud
6
- stub_remoter_for(@cloud)
7
- end
8
- describe "instance" do
9
- it "should be meaningfully spec'd" do
10
- pending
11
- end
12
- # before(:each) do
13
- # @pb = PoolParty::Provisioner::Capistrano.new(@remote_instance, @cloud)
14
- # end
15
- # it "should have the cloud set as the cloud" do
16
- # @pb.cloud.should == @cloud
17
- # end
18
- # it "should create the config on the initialize" do
19
- # @pb.config.class.should == ::Capistrano::Configuration
20
- # end
21
- # describe "config" do
22
- # it "should create the config at ::Capistrano::Logger::INFO if the cloud is verbose" do
23
- # @cloud.stub!(:verbose).and_return true
24
- # PoolParty::Provisioner::Capistrano.new(nil, @cloud).config.logger.level.should == ::Capistrano::Logger::INFO
25
- # end
26
- # it "should create the config at ::Capistrano::Logger::IMPORTANT if the cloud is not verbose" do
27
- # @cloud.stub!(:verbose).and_return false
28
- # PoolParty::Provisioner::Capistrano.new(nil, @cloud).config.logger.level.should == ::Capistrano::Logger::IMPORTANT
29
- # end
30
- # end
31
- # describe "install tasks" do
32
- # it "should have the configure tasks included" do
33
- # @pb.master_install_tasks.include?("custom_configure_tasks").should == true
34
- # end
35
- # it "should call the copy_gem_bins_to_usr_bin method" do
36
- # pending
37
- # end
38
- # end
39
- end
40
- end
@@ -1,129 +0,0 @@
1
- # TODO: Deprecate
2
-
3
- # require File.dirname(__FILE__) + '/../spec_helper'
4
- #
5
- # include Provisioner
6
- #
7
- # describe "ProvisionerBase" do
8
- # before(:each) do
9
- # ::Suitcase::Zipper.stub!(:gems).and_return true
10
- # # ::Suitcase::Zipper.stub!(:packages).and_return true
11
- # @cloud = new_test_cloud
12
- # @remote_instance = PoolParty::Remote::RemoteInstance.new({:ip => "192.168.0.1", :status => "running", :name => "master"}, @cloud)
13
- # @pb = PoolParty::Provisioner::ProvisionerBase.new(@remote_instance, @cloud)
14
- # stub_list_from_remote_for(@cloud)
15
- # stub_remoting_methods_for(@cloud)
16
- # Kernel.stub!(:sleep).and_return true
17
- # @cloud.stub!(:when_no_pending_instances).and_return true
18
- # @cloud.stub!(:when_all_assigned_ips).and_return true
19
- # end
20
- # describe "class methods" do
21
- # it "should have install" do
22
- # ProvisionerBase.respond_to?(:install).should == true
23
- # end
24
- # it "should have configure" do
25
- # ProvisionerBase.respond_to?(:configure).should == true
26
- # end
27
- # describe "in action" do
28
- # it "should call a new ProvisionerBase" do
29
- # ProvisionerBase.should_receive(:new).with(@remote_instance, @cloud).and_return @pb
30
- # @cloud.stub!(:remote_instances_list).and_return sample_instances_list
31
- # ProvisionerBase.install(@remote_instance, @cloud)
32
- # end
33
- # end
34
- # end
35
- # describe "instance methods" do
36
- # before(:each) do
37
- # @pb = PoolParty::Provisioner::ProvisionerBase.new(@remote_instance, @cloud)
38
- # stub_list_from_remote_for(@pb)
39
- # stub_list_from_remote_for(@cloud)
40
- # @cloud.stub!(:remote_instances_list).and_return sample_instances_list
41
- # stub_remoting_methods_for(@pb)
42
- # end
43
- # it "should store the instance on the ProvisionerBase" do
44
- # @pb.instance.should == @remote_instance
45
- # end
46
- # it "should store the cloud on the ProvisionerBase" do
47
- # @pb.cloud.should == @cloud
48
- # end
49
- # it "should say provision_master? is true if the remote instance name is master" do
50
- # @pb.provision_master?.should == true
51
- # end
52
- # it "should say the provision_master? is false if the remote instance is not the master" do
53
- # @remote_instance.stub!(:master?).and_return false
54
- # @pb.provision_master?.should == false
55
- # end
56
- # it "should say the provision_master? is false if the remote instance is nil" do
57
- # PoolParty::Provisioner::ProvisionerBase.new(nil, @cloud).provision_master?.should == false
58
- # end
59
- # describe "custom tasks" do
60
- # it "should call custom_configure_tasks_for on the cloud with the instance" do
61
- # @cloud.should_receive(:custom_configure_tasks_for).with(@remote_instance).and_return []
62
- # @pb.custom_configure_tasks
63
- # end
64
- # it "should call custom_install_tasks_for on the cloud with the instance" do
65
- # @cloud.should_receive(:custom_install_tasks_for).with(@remote_instance).and_return []
66
- # @pb.custom_install_tasks
67
- # end
68
- # end
69
- # describe "installation" do
70
- # it "should have an install method" do
71
- # @pb.respond_to?(:install).should == true
72
- # end
73
- # it "should call error if it is not valid" do
74
- # @pb.stub!(:valid?).and_return false
75
- # lambda {@pb.install}.should raise_error
76
- # end
77
- # it "should not raise an exception if it is valid" do
78
- # @pb.stub!(:valid?).and_return true
79
- # lambda {@pb.install(true)}.should_not raise_error
80
- # end
81
- # it "should call before_install with the instance" do
82
- # @pb.should_receive(:before_install).with(@remote_instance).and_return true
83
- # @pb.install
84
- # end
85
- # it "should call setup_runner" do
86
- # @pb.should_receive(:setup_runner).and_return true
87
- # @pb.install
88
- # end
89
- # it "should call process_install! with the testing" do
90
- # @pb.should_receive(:process_install!).with(false).and_return true
91
- # @pb.install
92
- # end
93
- # it "should call after_install with the instance" do
94
- # @pb.should_receive(:after_install).with(@remote_instance).and_return true
95
- # @pb.install
96
- # end
97
- # end
98
- # describe "configuration" do
99
- # it "should have a configure method" do
100
- # @pb.respond_to?(:configure).should == true
101
- # end
102
- # it "should call error if it is not valid" do
103
- # @pb.stub!(:valid?).and_return false
104
- # lambda {@pb.configure}.should raise_error
105
- # end
106
- # it "should not raise an exception if it is valid" do
107
- # @pb.stub!(:valid?).and_return true
108
- # lambda {@pb.configure(true)}.should_not raise_error
109
- # end
110
- # it "should call before_configure with the instance" do
111
- # @pb.should_receive(:before_configure).with(@remote_instance).and_return true
112
- # @pb.configure
113
- # end
114
- # it "should call setup_runner" do
115
- # @pb.should_receive(:setup_runner).and_return true
116
- # @pb.configure
117
- # end
118
- # it "should call process_configure! with the testing" do
119
- # @pb.should_receive(:process_configure!).with(false).and_return true
120
- # @pb.configure
121
- # end
122
- # it "should call after_configure with the instance" do
123
- # @pb.should_receive(:after_configure).with(@remote_instance).and_return true
124
- # @pb.configure
125
- # end
126
- #
127
- # end
128
- # end
129
- # end