Module: MiniTest::Unit::ProvisionedTestCase::ProvisionHelper
- Defined in:
- lib/chef-workflow/test-case/provisioned.rb
Instance Method Summary collapse
-
#deprovision(role) ⇒ Object
De-Provision a server group.
-
#get_role_ips(role) ⇒ Object
Obtains the IP addresses for a given role as an array.
- #inherited(klass) ⇒ Object
-
#knife_config ⇒ Object
Easy way to reference KnifeSupport for getting configuration data.
-
#provision(role, number_of_servers = 1, addl_dependencies = []) ⇒ Object
Provision a server group.
-
#provision_helper ⇒ Object
Retrieves the provision helper.
-
#provision_helper=(arg) ⇒ Object
Sets the provision helper.
-
#wait_for(*deps) ⇒ Object
wait for a provision.
Instance Method Details
#deprovision(role) ⇒ Object
De-Provision a server group. Takes a name. Delegates to the provision helper.
61 62 63 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 61 def deprovision(role) provision_helper.deprovision(role) end |
#get_role_ips(role) ⇒ Object
Obtains the IP addresses for a given role as an array.
68 69 70 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 68 def get_role_ips(role) ChefWorkflow::IPSupport.get_role_ips(role) end |
#inherited(klass) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 18 def inherited(klass) unless klass.provision_helper klass.provision_helper = self.provision_helper end MiniTest::Unit::TestCase.inherited(klass) end |
#knife_config ⇒ Object
Easy way to reference KnifeSupport for getting configuration data.
75 76 77 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 75 def knife_config ChefWorkflow::KnifeSupport end |
#provision(role, number_of_servers = 1, addl_dependencies = []) ⇒ Object
Provision a server group. Takes a name, number of servers, and a list of dependencies (server group names). Delegates to the provision helper.
52 53 54 55 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 52 def provision(role, number_of_servers=1, addl_dependencies=[]) provision_helper.provision(role, number_of_servers, addl_dependencies) provision_helper.run end |
#provision_helper ⇒ Object
Retrieves the provision helper.
29 30 31 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 29 def provision_helper @provision_helper || (self.class.provision_helper rescue nil) end |
#provision_helper=(arg) ⇒ Object
Sets the provision helper.
36 37 38 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 36 def provision_helper=(arg) @provision_helper = arg end |
#wait_for(*deps) ⇒ Object
wait for a provision. takes a list of server group names. delegates to the provision helper.
44 45 46 |
# File 'lib/chef-workflow/test-case/provisioned.rb', line 44 def wait_for(*deps) provision_helper.wait_for(*deps) end |