auser-poolparty 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/VERSION.yml +1 -1
  2. data/bin/cloud-list +4 -4
  3. data/bin/cloud-provision +2 -0
  4. data/bin/cloud-ssh +1 -1
  5. data/bin/install-poolparty +1 -1
  6. data/examples/fairchild.rb +26 -17
  7. data/examples/metavirt_cloud.rb +2 -4
  8. data/lib/poolparty.rb +2 -7
  9. data/lib/poolparty/core/array.rb +1 -1
  10. data/lib/poolparty/core/exception.rb +1 -1
  11. data/lib/poolparty/core/hash.rb +12 -5
  12. data/lib/poolparty/core/integer.rb +11 -0
  13. data/lib/poolparty/core/object.rb +14 -0
  14. data/lib/poolparty/core/string.rb +6 -1
  15. data/lib/poolparty/core/time.rb +6 -0
  16. data/lib/poolparty/extra/duration.rb +96 -0
  17. data/lib/poolparty/helpers/binary.rb +1 -1
  18. data/lib/poolparty/modules/cloud_resourcer.rb +1 -1
  19. data/lib/poolparty/modules/definable_resource.rb +5 -7
  20. data/lib/poolparty/modules/output.rb +2 -2
  21. data/lib/poolparty/monitors/base_monitor.rb +17 -0
  22. data/lib/poolparty/net/init.rb +4 -11
  23. data/lib/poolparty/net/remote_instance.rb +5 -0
  24. data/lib/poolparty/net/remoter/connections.rb +14 -11
  25. data/lib/poolparty/net/remoter/interactive.rb +13 -2
  26. data/lib/poolparty/net/remoter_base.rb +9 -4
  27. data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +50 -35
  28. data/lib/poolparty/net/remoter_bases/ec2/ec2_remote_instance.rb +46 -5
  29. data/lib/poolparty/net/remoter_bases/ec2/ec2_response_object.rb +57 -1
  30. data/lib/poolparty/plugins/apache2/apache.rb +13 -160
  31. data/lib/poolparty/plugins/apache2/passenger_site.rb +86 -0
  32. data/lib/poolparty/plugins/apache2/php5.rb +40 -0
  33. data/lib/poolparty/plugins/apache2/virtual_host.rb +53 -0
  34. data/lib/poolparty/plugins/authorized_key.rb +2 -2
  35. data/lib/poolparty/plugins/bind.rb +5 -6
  36. data/lib/poolparty/plugins/{chef.rb → chef/chef.rb} +22 -18
  37. data/lib/poolparty/plugins/{chef_deploy.rb → chef/chef_deploy.rb} +20 -19
  38. data/lib/poolparty/plugins/deploy_directory.rb +2 -3
  39. data/lib/poolparty/plugins/gem_package.rb +6 -12
  40. data/lib/poolparty/plugins/git.rb +22 -7
  41. data/lib/poolparty/{base_packages → plugins}/haproxy.rb +2 -2
  42. data/lib/poolparty/{base_packages → plugins}/heartbeat.rb +7 -7
  43. data/lib/poolparty/plugins/line_in_file.rb +4 -2
  44. data/lib/poolparty/plugins/plugin_template.rb +13 -0
  45. data/lib/poolparty/{base_packages/poolparty.rb → plugins/poolparty_base_packages.rb} +2 -2
  46. data/lib/poolparty/plugins/rails_deploy.rb +2 -3
  47. data/lib/poolparty/{base_packages → plugins}/ruby.rb +3 -3
  48. data/lib/poolparty/{base_packages → plugins}/runit.rb +3 -3
  49. data/lib/poolparty/plugins/svn.rb +8 -6
  50. data/lib/poolparty/poolparty/cloud.rb +5 -8
  51. data/lib/poolparty/poolparty/default.rb +1 -1
  52. data/lib/poolparty/poolparty/plugin.rb +36 -15
  53. data/lib/poolparty/poolparty/pool.rb +6 -2
  54. data/lib/poolparty/poolparty/poolparty_base_class.rb +5 -11
  55. data/lib/poolparty/poolparty/resource.rb +2 -1
  56. data/lib/poolparty/poolparty/service.rb +6 -8
  57. data/lib/poolparty/provision/dr_configure.rb +3 -3
  58. data/lib/poolparty/verification/verifier_base.rb +10 -0
  59. data/spec/bin/server-list-active_spec.rb +1 -3
  60. data/spec/poolparty/core/string_spec.rb +1 -1
  61. data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +0 -2
  62. data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +16 -13
  63. data/spec/poolparty/extra/deployments_spec.rb +68 -68
  64. data/spec/poolparty/net/remoter_bases/ec2_spec.rb +1 -0
  65. data/spec/poolparty/plugins/deploydirectory_spec.rb +64 -51
  66. data/spec/poolparty/poolparty/cloud_spec.rb +21 -19
  67. data/spec/poolparty/poolparty/configurers/files/ruby_basic.rb +1 -1
  68. data/spec/poolparty/poolparty/configurers/files/ruby_plugins.rb +1 -1
  69. data/spec/poolparty/{base_packages → poolparty}/haproxy_spec.rb +1 -1
  70. data/spec/poolparty/{base_packages → poolparty}/heartbeat_spec.rb +1 -1
  71. data/spec/poolparty/poolparty/plugin_model_spec.rb +6 -13
  72. data/spec/poolparty/poolparty/plugin_spec.rb +7 -7
  73. data/spec/poolparty/poolparty/resource_spec.rb +15 -5
  74. data/spec/poolparty/poolparty/test_plugins/webserver.rb +27 -23
  75. data/test/fixtures/metavirt_cloud.json +1 -0
  76. data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +0 -5
  77. data/test/poolparty/modules/cloud_dsl_test.rb +1 -1
  78. data/test/poolparty/monitors/test_base_monitor.rb +17 -0
  79. data/test/poolparty/monitors/test_monitor_rack.rb +39 -0
  80. data/test/poolparty/net/remoter_base_test.rb +18 -0
  81. data/test/poolparty/plugins/chef_deploy_test.rb +1 -1
  82. data/test/poolparty/plugins/rails_deploy_test.rb +3 -3
  83. data/test/poolparty/poolparty/cloud_test.rb +27 -2
  84. data/test/poolparty/poolparty/isolated_cloud_test.rb +25 -0
  85. data/test/poolparty/poolparty/plugin_test.rb +9 -8
  86. data/test/poolparty/poolparty/schema_test.rb +13 -0
  87. data/test/poolparty/verification/verify_test.rb +4 -0
  88. data/test/test_helper.rb +10 -3
  89. data/test/test_methods.rb +11 -0
  90. data/vendor/gems/dslify/test/dslify_test.rb +28 -0
  91. metadata +29 -15
  92. data/lib/poolparty/extra/deployments.rb +0 -31
  93. data/lib/poolparty/poolparty/plugin_model.rb +0 -46
@@ -9,7 +9,7 @@ pool :poolpartyrb do
9
9
  :document_root => "/www/domain2",
10
10
  :server_name => "domain2.com"
11
11
  })
12
- end
12
+ end
13
13
 
14
14
  end
15
15
 
@@ -2,6 +2,6 @@ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe "haproxy base package" do
4
4
  it "should have the haproxy package defined" do
5
- lambda {HaproxyClass}.should_not raise_error
5
+ lambda {Plugin::Haproxy}.should_not raise_error
6
6
  end
7
7
  end
@@ -2,6 +2,6 @@ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe "heartbeat base package" do
4
4
  it "should have the heartbeat package defined" do
5
- lambda {PoolpartyBaseHeartbeatClass}.should_not raise_error
5
+ lambda {Plugin::Heartbeat}.should_not raise_error
6
6
  end
7
7
  end
@@ -5,34 +5,27 @@ describe "Plugin" do
5
5
  before(:each) do
6
6
  reset!
7
7
  @c = cloud :test_plugin_model_cloud do
8
- apachetest do
8
+ apache_test do
9
9
  site("heady", {
10
10
  :document_root => "/root"
11
11
  })
12
12
  end
13
13
  end
14
14
  end
15
- describe "methods should include" do
16
- it "register_plugin(plugin)" do;WebServers.respond_to?(:register_plugin).should == true;end
17
- end
15
+
18
16
  describe "registered" do
19
17
  before(:each) do
20
- @plugin = @c.apachetest
18
+ @plugin = @c.apache_test
21
19
  end
22
20
 
23
- describe "storage" do
24
- it "should be able to retrieve the plugin as a name" do
25
- @c.plugin("apachetest").should_not be_nil
26
- end
27
- end
28
- it "be of the class apachetesttestClass on the Kernel" do
29
- @plugin.class.should == Kernel::ApachetestClass
21
+ it "be of the class apache_testtestClass on the Kernel" do
22
+ @plugin.class.should == PoolParty::Plugin::ApacheTest
30
23
  end
31
24
  it "should store the regsitered plugins in an array" do
32
25
  @plugin.should_not be_nil
33
26
  end
34
27
  it "should have the plugin name as a method on the cloud " do
35
- @c.respond_to?(:apachetest).should == true
28
+ @c.respond_to?(:apache_test).should == true
36
29
  end
37
30
 
38
31
  describe "methods" do
@@ -8,33 +8,33 @@ describe "Plugin" do
8
8
  before(:each) do
9
9
  reset!
10
10
  cloud :app_for_plugin do
11
- apachetest do
11
+ apache_test do
12
12
  enable_php
13
13
  site("heady", {
14
14
  :document_root => "/root"
15
15
  })
16
16
  end
17
- apachetest do
17
+ apache_test do
18
18
  site("boob")
19
19
  end
20
20
  end
21
- @plugin = clouds[:app_for_plugin].apachetest
21
+ @plugin = clouds[:app_for_plugin].apache_test
22
22
  end
23
23
  it "should not be empty" do
24
- clouds[:app_for_plugin].apachetest.class.should == ApachetestClass
24
+ clouds[:app_for_plugin].apache_test.class.should == ::PoolParty::Plugin::ApacheTest
25
25
  end
26
26
  it "should set loaded == true" do
27
- clouds[:app_for_plugin].apachetest.loaded.should == true
27
+ clouds[:app_for_plugin].apache_test.loaded.should == true
28
28
  end
29
29
  it "should have enable_php as a method" do
30
- ApachetestClass.new.respond_to?(:enable_php).should == true
30
+ ::PoolParty::Plugin::ApacheTest.new.respond_to?(:enable_php).should == true
31
31
  end
32
32
  it "should set enable_php" do
33
33
  @plugin.enable_php.should == true
34
34
  end
35
35
  it "should store the plugin in the clouds plugin_store" do
36
36
  clouds[:app_for_plugin].plugin_store[-2].class.should == @plugin.class
37
- clouds[:app_for_plugin].apachetest
37
+ clouds[:app_for_plugin].apache_test
38
38
  clouds[:app_for_plugin].plugin_store[-2].class.should == @plugin.class
39
39
  end
40
40
  end
@@ -26,11 +26,21 @@ describe "Resource" do
26
26
  @resource.c.should == 3
27
27
  end
28
28
  describe "class methods" do
29
- it "should have an array of available resources" do
30
- PoolParty::Resources::Resource.available_resources.class.should == Array
31
- end
32
- it "should not be empty" do
33
- PoolParty::Resources::Resource.available_resources.empty?.should == false
29
+ describe "available resources" do
30
+ before(:each) do
31
+ @available = PoolParty::Resources::Resource.available_resources
32
+ end
33
+ it "should be an array" do
34
+ @available.class.should == Array
35
+ end
36
+ it "should not be empty" do
37
+ @available.empty?.should == false
38
+ end
39
+ it "should have some basic resources" do
40
+ @available.should include(PoolParty::Resources::Cron)
41
+ @available.should include(PoolParty::Resources::File)
42
+ @available.should include(PoolParty::Resources::Package)
43
+ end
34
44
  end
35
45
  end
36
46
  describe "instance methods" do
@@ -1,28 +1,32 @@
1
- class WebServers
2
- plugin :apachetest do
3
- def loaded(o={}, &block)
4
- @loaded ||= true
5
- end
6
-
7
- def enable
8
- end
9
-
10
- def enable_php
11
- @php = true
12
- end
13
-
14
- def php
15
- @php ||= false
16
- end
1
+ module PoolParty
2
+ module Plugin
17
3
 
18
- def site(name=:domain1, opts={})
19
- virtual_host name, opts
4
+ class ApacheTest < Plugin
5
+ def loaded(o={}, &block)
6
+ @loaded ||= true
7
+ end
8
+
9
+ def enable
10
+ end
11
+
12
+ def enable_php
13
+ @php = true
14
+ end
15
+
16
+ def php
17
+ @php ||= false
18
+ end
19
+
20
+ def site(name=:domain1, opts={})
21
+ virtual_host name, opts
22
+ end
23
+
24
+ def virtual_host(name, opts={})
25
+ opts = {
26
+ :document_root => opts[:document_root] || "/www/#{name}/"
27
+ }
28
+ end
20
29
  end
21
30
 
22
- def virtual_host(name, opts={})
23
- opts = {
24
- :document_root => opts[:document_root] || "/www/#{name}/"
25
- }
26
- end
27
31
  end
28
32
  end
@@ -0,0 +1 @@
1
+ {"resources":[{"owner":null,"mode":"644","content":"Welcome to your poolparty instance!","template":null,"ensures":"create","pp_type":"file","name":"\/etc\/motd"},{"resources":[],"pp_type":"plugin","name":"chef_class","options":{}}],"options":{"remote_base":{"remote_base":{"vmx_hash":{},"images_repo_path":"\/Users\/mfairchild\/Documents\/Virtual_Machines.localized","path_to_binary":"vmrun","vmx_files":["\/Users\/mfairchild\/Documents\/Virtual Machines.localized\/Ubuntu-jaunty.vmwarevm\/Ubuntu-jaunty.vmx","\/Users\/mfairchild\/Documents\/Virtual Machines.localized\/metavirts\/Ubuntu32bitVM copy.vmwarevm\/Ubuntu32bitVM.vmx"],"default_cli_options":"gui","terminate_options":"soft"},"authorized_keys":"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCTppECfx7Tb0zoviRfqFaePyAek6+ZktKkHiTHu\/jkhG1s4q1oHEe89no21xLxuReyJrDlNe8rLxxZzoYCaAWRdhcqMR3BNqb2w2jpF4pH+bFj0557KrwWP6HSNpRRkyYhxLqZbuH\/2t3TzkPevZbcfSYa09jIzqnmTruh9l1s+n5E3cNr\/RDdDn7tv3Ok7mKN7GEjkK7F83Pt9xviHevg22xqzm99nS+hg6Kl\/fQUTO6pOmC5x+9V47RJz1+9WdhGJ7M83zijX9rMnAwrR5LFoL6aZyyU0G71SpoIL5e8XD\/jt1WNKFJOfG8YMLb3i03UABm\/Q5Q30+R7UoRxSWRX","keypair_name":null,"remoter_base":"vmrun","keypair_path":null,"server_config":{"port":3000,"host":"172.16.68.1"}},"debugging":false,"minimum_instances":2,"forwarding_port":"8080","rules":{"contract":"load < 0.25","expand":"load > 0.9"},"availability_zone":"us-east-1a","base_keypair_path":"\/Users\/mfairchild\/.ec2","template_path":"\/var\/lib\/puppet\/templates","port":"80","expand_when":"load > 0.9","testing":false,"maximum_instances":2,"monitor_port":8081,"availabilty_zone":"us-east-1a","security_group":["default"],"tmp_path":"\/tmp\/poolparty","module_path":"\/etc\/puppet\/modules\/poolparty","poolparty_src_path":".\/examples\/..\/lib\/poolparty\/poolparty\/..\/..\/..","ec2_dir":"\/Users\/mfairchild\/opt\/ec2","elastic_ips":null,"keypair_name":"front","proxy_mode":"http","default_specfile_name":"clouds.rb","image_id":null,"ebs_volume_id":null,"user":"root","base_ssh_path":"\/Users\/mfairchild\/.ssh","template_directory":"templates","butterfly_port":8642,"keypair":"\/Users\/mfairchild\/.ec2\/front","base_config_directory":"\/etc\/poolparty","properties_hash_filename":"clouds.json","access_key":null,"remoter_base":"metavirt","keypair_path":"\/Users\/mfairchild\/.ec2\/front","instance_type":"m1.small","verbose":false,"debug":false,"remote_gem_path":"\/var\/poolparty\/gems","minimum_runtime":3000,"name":"vv","cloud_name":"vv","remote_storage_path":"\/var\/poolparty","vendor_path":".\/examples\/..\/lib\/poolparty\/poolparty\/..\/..\/..\/vendor","secret_access_key":null,"dependency_resolver":"ChefResolver","addressing_type":"public","poolparty_home_path":"\/Users\/mfairchild\/.poolparty","fileserver_base":"puppet:\/\/master\/files","contract_when":"load < 0.25"}}
@@ -1,10 +1,5 @@
1
1
  require "#{::File.dirname(__FILE__)}/../../test_helper"
2
2
 
3
- class PuppetResolverSpec
4
- plugin :apache do
5
- end
6
- end
7
-
8
3
  class TestPuppetResolver < Test::Unit::TestCase
9
4
  context "from a hash" do
10
5
  setup do
@@ -52,7 +52,7 @@ class TestCloudDsl < Test::Unit::TestCase
52
52
  should "call haproxy when adding enabled serivces" do
53
53
  @cloud.add_optional_enabled_services
54
54
  klasses = @cloud.plugin_store.map {|a| a.class.to_s.split("::")[-1] }
55
- klasses.include?("HaproxyClass").should == true
55
+ klasses.include?("Haproxy").should == true
56
56
  end
57
57
  end
58
58
 
@@ -0,0 +1,17 @@
1
+ require "#{::File.dirname(__FILE__)}/../../test_helper"
2
+
3
+ class BaseMonitorTest < Test::Unit::TestCase
4
+ context "Available Monitors" do
5
+ should "start out with available monitors" do
6
+ assert Monitors.available.size > 5
7
+ assert Monitors.available.include? Monitors::Load
8
+ end
9
+
10
+ should "have available_monitors" do
11
+ class ExtraFoo < ::Monitors::BaseMonitor; end
12
+ assert Monitors.available.include? ExtraFoo
13
+ end
14
+
15
+ end
16
+
17
+ end
@@ -0,0 +1,39 @@
1
+ require "#{::File.dirname(__FILE__)}/../../test_helper"
2
+ require 'tempfile'
3
+
4
+ class MonitorRackTest < Test::Unit::TestCase
5
+ context "MonitorRack" do
6
+ setup do
7
+ @rackup=<<EOS
8
+ #!/usr/bin/env ruby
9
+ require 'rubygems'
10
+ require 'rack'
11
+ require 'json'
12
+ require 'thin'
13
+ require 'rest_client'
14
+ require "#{::File.dirname(__FILE__)}/../../../lib/poolparty/monitors/monitor_rack"
15
+
16
+ app = Rack::Builder.new do
17
+ # use Rack::Reloader, 2
18
+ use Rack::ShowExceptions
19
+ # use Rack::PostBodyContentTypeParser #parses json requests to params hash
20
+ run Monitors::MonitorRack.new()
21
+ end
22
+
23
+ run app
24
+ EOS
25
+ end
26
+
27
+ should "be able to start" do
28
+ tfile = Tempfile.new('monitor_rackup.ru'){|f| f.write @rackup}
29
+
30
+ output = `thin -R #{tfile.path} start --daemon`
31
+
32
+ assert $?.success?
33
+ # `thin -R #{tfile.path} stop`
34
+ assert $?.success?
35
+ tfile.unlink
36
+ end
37
+ end
38
+
39
+ end
@@ -0,0 +1,18 @@
1
+ require "#{::File.dirname(__FILE__)}/../../test_helper"
2
+
3
+ class RemoterBaseTest < Test::Unit::TestCase
4
+ context "Available Bases" do
5
+
6
+ should "have global remote_bases" do
7
+ assert !remote_bases.nil?
8
+ assert remote_bases.size >1
9
+ assert remote_bases.include?(:ec2)
10
+ assert $remote_bases == remote_bases
11
+ end
12
+
13
+ should "have remote_bases class method " do
14
+ assert ::PoolParty::Remote::RemoterBase.available_bases.include?(:ec2)
15
+ end
16
+ end
17
+
18
+ end
@@ -15,7 +15,7 @@ class TestChefDeploy < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  should "place a resource on the cloud" do
18
- @cloud.ordered_resources.first.class.should == ChefDeployClass
18
+ assert_equal PoolParty::Plugin::ChefDeploy, @cloud.ordered_resources.first.class
19
19
  end
20
20
  should "raise if :repo is not passed" do
21
21
  assert_raise ReposMissingError do
@@ -15,7 +15,7 @@ class TestRailsDeploy < Test::Unit::TestCase
15
15
  end
16
16
 
17
17
  should "place a resource on the cloud" do
18
- @cloud.ordered_resources.first.class.should == RailsDeployClass
18
+ assert_equal PoolParty::Plugin::RailsDeploy, @cloud.ordered_resources.first.class
19
19
  end
20
20
  should "raise if :repo is not passed" do
21
21
  assert_raise PoolParty::ReposMissingError do
@@ -34,8 +34,8 @@ class TestRailsDeploy < Test::Unit::TestCase
34
34
  end
35
35
  should "create the directory tree" do
36
36
  arr = @cloud.rails_deploys.first.directorys.map {|a| a.name }
37
- ["/shared", "/shared/config", "/shared/pids", "/shared/log", "/shared/system"].each do |dir|
38
- assert arr.include?("/var/www/paparazzi#{dir}")
37
+ ["shared", "shared/config", "shared/pids", "shared/log", "shared/system"].each do |dir|
38
+ assert arr.include?("/var/www/paparazzi/#{dir}")
39
39
  end
40
40
  end
41
41
  should "have git-core defined as a package" do
@@ -1,13 +1,38 @@
1
1
  require "#{::File.dirname(__FILE__)}/../../test_helper"
2
2
 
3
3
  class CloudTest < Test::Unit::TestCase
4
+ context "pulling options" do
5
+ setup do
6
+ reset!
7
+ pool :test_pool_test do
8
+ access_key "pool_access_key"
9
+ cloud :orange do
10
+ secret_access_key "cloud_access_key"
11
+ end
12
+ end
13
+ end
14
+
15
+ should "have access key on the cloud" do
16
+ assert_equal "pool_access_key", pools[:test_pool_test].access_key
17
+ assert_equal "pool_access_key", clouds[:orange].access_key
18
+ assert_equal "cloud_access_key", clouds[:orange].secret_access_key
19
+ end
20
+ should "set the access_key even if the AWS_ACCESS_KEY is nil" do
21
+ modify_env_with_hash("AWS_ACCESS_KEY" => nil)
22
+ assert_equal "pool_access_key", clouds[:orange].access_key
23
+ end
24
+ should "set the secret_access_key even if the AWS_SECRET_ACCESS_KEY is nil" do
25
+ modify_env_with_hash("AWS_SECRET_ACCESS_KEY" => nil)
26
+ assert_equal "cloud_access_key", clouds[:orange].secret_access_key
27
+ end
28
+ end
29
+
4
30
  context "callbacks" do
5
31
  setup do
6
32
  reset!
7
33
  cloud :apple do
8
34
  user "bob"
9
- minimum_instances 100
10
- access_key "pool_access_key"
35
+ minimum_instances 100
11
36
  secret_access_key "cloud_access_key"
12
37
 
13
38
  after :bootstrap do |cld|
@@ -0,0 +1,25 @@
1
+ require "rubygems"
2
+ require "test/unit"
3
+ require "matchy"
4
+ require "shoulda"
5
+ require File.dirname(__FILE__) + '/../../../lib/poolparty'
6
+
7
+ class CloudTest < Test::Unit::TestCase
8
+ context "pulling options" do
9
+ setup do
10
+ reset!
11
+ pool :test_pool_test do
12
+ access_key "pool_access_key"
13
+ cloud :orange do
14
+ secret_access_key "cloud_access_key"
15
+ end
16
+ end
17
+ end
18
+ should "set the access_keys" do
19
+ assert_equal "pool_access_key", pools[:test_pool_test].access_key
20
+ assert_equal nil, pools[:test_pool_test].secret_access_key
21
+ assert_equal "pool_access_key", clouds[:orange].access_key
22
+ assert_equal "cloud_access_key", clouds[:orange].secret_access_key
23
+ end
24
+ end
25
+ end
@@ -1,18 +1,19 @@
1
1
  require "#{::File.dirname(__FILE__)}/../../test_helper"
2
2
 
3
- class PluginClass
4
- plugin :box do
3
+ module PoolParty
4
+ module Plugin
5
+ class Box < Plugin
6
+ end
5
7
  end
6
8
  end
7
9
 
8
10
  class TestPlugins < Test::Unit::TestCase
9
11
  context "services" do
10
- setup do
11
- reset!
12
- @tbc = TestBaseClass.new do
13
- box do
14
- end
15
- end
12
+
13
+ should " have array of availble plugins" do
14
+ assert Plugin.available.include?(PoolParty::Plugin::Box)
15
+ assert Plugin.available.include?(PoolParty::Plugin::Git)
16
16
  end
17
+
17
18
  end
18
19
  end
@@ -0,0 +1,13 @@
1
+ require "#{::File.dirname(__FILE__)}/../../test_helper"
2
+
3
+ class TestSchema < Test::Unit::TestCase
4
+ should "should be able to load from json string" do
5
+ schema = PoolParty::Schema.new(open(::File.dirname(__FILE__)+'/../../fixtures/metavirt_cloud.json').read)
6
+ assert 'metavirt', schema['name']
7
+ assert 'PoolParty::Remote::Metavirt', schema.options.remote_base
8
+ end
9
+ should "dump to_json" do
10
+ #TODO
11
+ end
12
+
13
+ end
@@ -33,6 +33,10 @@ class TestVerification < Test::Unit::TestCase
33
33
  end
34
34
  end
35
35
  end
36
+ should "have available_verifiers" do
37
+ Verifiers.available.grep /Ding/
38
+ end
39
+
36
40
  should "have a the ping verifier as a verifiers in the class" do
37
41
  @vc.verifiers.first.class.should == PoolParty::Verifiers::Ding
38
42
  end