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.
- data/VERSION.yml +1 -1
- data/bin/cloud-list +4 -4
- data/bin/cloud-provision +2 -0
- data/bin/cloud-ssh +1 -1
- data/bin/install-poolparty +1 -1
- data/examples/fairchild.rb +26 -17
- data/examples/metavirt_cloud.rb +2 -4
- data/lib/poolparty.rb +2 -7
- data/lib/poolparty/core/array.rb +1 -1
- data/lib/poolparty/core/exception.rb +1 -1
- data/lib/poolparty/core/hash.rb +12 -5
- data/lib/poolparty/core/integer.rb +11 -0
- data/lib/poolparty/core/object.rb +14 -0
- data/lib/poolparty/core/string.rb +6 -1
- data/lib/poolparty/core/time.rb +6 -0
- data/lib/poolparty/extra/duration.rb +96 -0
- data/lib/poolparty/helpers/binary.rb +1 -1
- data/lib/poolparty/modules/cloud_resourcer.rb +1 -1
- data/lib/poolparty/modules/definable_resource.rb +5 -7
- data/lib/poolparty/modules/output.rb +2 -2
- data/lib/poolparty/monitors/base_monitor.rb +17 -0
- data/lib/poolparty/net/init.rb +4 -11
- data/lib/poolparty/net/remote_instance.rb +5 -0
- data/lib/poolparty/net/remoter/connections.rb +14 -11
- data/lib/poolparty/net/remoter/interactive.rb +13 -2
- data/lib/poolparty/net/remoter_base.rb +9 -4
- data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +50 -35
- data/lib/poolparty/net/remoter_bases/ec2/ec2_remote_instance.rb +46 -5
- data/lib/poolparty/net/remoter_bases/ec2/ec2_response_object.rb +57 -1
- data/lib/poolparty/plugins/apache2/apache.rb +13 -160
- data/lib/poolparty/plugins/apache2/passenger_site.rb +86 -0
- data/lib/poolparty/plugins/apache2/php5.rb +40 -0
- data/lib/poolparty/plugins/apache2/virtual_host.rb +53 -0
- data/lib/poolparty/plugins/authorized_key.rb +2 -2
- data/lib/poolparty/plugins/bind.rb +5 -6
- data/lib/poolparty/plugins/{chef.rb → chef/chef.rb} +22 -18
- data/lib/poolparty/plugins/{chef_deploy.rb → chef/chef_deploy.rb} +20 -19
- data/lib/poolparty/plugins/deploy_directory.rb +2 -3
- data/lib/poolparty/plugins/gem_package.rb +6 -12
- data/lib/poolparty/plugins/git.rb +22 -7
- data/lib/poolparty/{base_packages → plugins}/haproxy.rb +2 -2
- data/lib/poolparty/{base_packages → plugins}/heartbeat.rb +7 -7
- data/lib/poolparty/plugins/line_in_file.rb +4 -2
- data/lib/poolparty/plugins/plugin_template.rb +13 -0
- data/lib/poolparty/{base_packages/poolparty.rb → plugins/poolparty_base_packages.rb} +2 -2
- data/lib/poolparty/plugins/rails_deploy.rb +2 -3
- data/lib/poolparty/{base_packages → plugins}/ruby.rb +3 -3
- data/lib/poolparty/{base_packages → plugins}/runit.rb +3 -3
- data/lib/poolparty/plugins/svn.rb +8 -6
- data/lib/poolparty/poolparty/cloud.rb +5 -8
- data/lib/poolparty/poolparty/default.rb +1 -1
- data/lib/poolparty/poolparty/plugin.rb +36 -15
- data/lib/poolparty/poolparty/pool.rb +6 -2
- data/lib/poolparty/poolparty/poolparty_base_class.rb +5 -11
- data/lib/poolparty/poolparty/resource.rb +2 -1
- data/lib/poolparty/poolparty/service.rb +6 -8
- data/lib/poolparty/provision/dr_configure.rb +3 -3
- data/lib/poolparty/verification/verifier_base.rb +10 -0
- data/spec/bin/server-list-active_spec.rb +1 -3
- data/spec/poolparty/core/string_spec.rb +1 -1
- data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +0 -2
- data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +16 -13
- data/spec/poolparty/extra/deployments_spec.rb +68 -68
- data/spec/poolparty/net/remoter_bases/ec2_spec.rb +1 -0
- data/spec/poolparty/plugins/deploydirectory_spec.rb +64 -51
- data/spec/poolparty/poolparty/cloud_spec.rb +21 -19
- data/spec/poolparty/poolparty/configurers/files/ruby_basic.rb +1 -1
- data/spec/poolparty/poolparty/configurers/files/ruby_plugins.rb +1 -1
- data/spec/poolparty/{base_packages → poolparty}/haproxy_spec.rb +1 -1
- data/spec/poolparty/{base_packages → poolparty}/heartbeat_spec.rb +1 -1
- data/spec/poolparty/poolparty/plugin_model_spec.rb +6 -13
- data/spec/poolparty/poolparty/plugin_spec.rb +7 -7
- data/spec/poolparty/poolparty/resource_spec.rb +15 -5
- data/spec/poolparty/poolparty/test_plugins/webserver.rb +27 -23
- data/test/fixtures/metavirt_cloud.json +1 -0
- data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +0 -5
- data/test/poolparty/modules/cloud_dsl_test.rb +1 -1
- data/test/poolparty/monitors/test_base_monitor.rb +17 -0
- data/test/poolparty/monitors/test_monitor_rack.rb +39 -0
- data/test/poolparty/net/remoter_base_test.rb +18 -0
- data/test/poolparty/plugins/chef_deploy_test.rb +1 -1
- data/test/poolparty/plugins/rails_deploy_test.rb +3 -3
- data/test/poolparty/poolparty/cloud_test.rb +27 -2
- data/test/poolparty/poolparty/isolated_cloud_test.rb +25 -0
- data/test/poolparty/poolparty/plugin_test.rb +9 -8
- data/test/poolparty/poolparty/schema_test.rb +13 -0
- data/test/poolparty/verification/verify_test.rb +4 -0
- data/test/test_helper.rb +10 -3
- data/test/test_methods.rb +11 -0
- data/vendor/gems/dslify/test/dslify_test.rb +28 -0
- metadata +29 -15
- data/lib/poolparty/extra/deployments.rb +0 -31
- data/lib/poolparty/poolparty/plugin_model.rb +0 -46
@@ -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
|
-
|
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
|
-
|
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.
|
18
|
+
@plugin = @c.apache_test
|
21
19
|
end
|
22
20
|
|
23
|
-
|
24
|
-
|
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?(:
|
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
|
-
|
11
|
+
apache_test do
|
12
12
|
enable_php
|
13
13
|
site("heady", {
|
14
14
|
:document_root => "/root"
|
15
15
|
})
|
16
16
|
end
|
17
|
-
|
17
|
+
apache_test do
|
18
18
|
site("boob")
|
19
19
|
end
|
20
20
|
end
|
21
|
-
@plugin = clouds[:app_for_plugin].
|
21
|
+
@plugin = clouds[:app_for_plugin].apache_test
|
22
22
|
end
|
23
23
|
it "should not be empty" do
|
24
|
-
clouds[:app_for_plugin].
|
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].
|
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
|
-
|
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].
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
2
|
-
|
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
|
-
|
19
|
-
|
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"}}
|
@@ -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?("
|
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
|
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
|
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
|
-
["
|
38
|
-
assert arr.include?("/var/www/paparazzi
|
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
|
-
|
4
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|