[compute] consolidate testing

This commit is contained in:
geemus 2011-01-03 13:34:08 -08:00
parent 7dbe810fd1
commit ed153088d0
63 changed files with 63 additions and 85 deletions

View File

@ -1,5 +0,0 @@
Shindo.tests('AWS::Compute | flavors collection', ['aws']) do
flavors_tests(AWS[:compute])
end

View File

@ -1,6 +0,0 @@
Shindo.tests('AWS::Compute | server model', ['aws']) do
# image ami-1a837773 = Ubuntu
server_tests(AWS[:compute], {:image_id => 'ami-1a837773'})
end

View File

@ -1,6 +0,0 @@
Shindo.tests('AWS::Compute | servers collection', ['aws']) do
# image ami-1a837773 = Ubuntu
servers_tests(AWS[:compute], {:image_id => 'ami-1a837773'})
end

View File

@ -1,5 +0,0 @@
Shindo.tests('Bluebox::Compute | flavors collection', ['bluebox']) do
flavors_tests(Bluebox[:compute], {}, false)
end

View File

@ -1,5 +0,0 @@
Shindo.tests('Bluebox::Compute | server model', ['bluebox']) do
server_tests(Bluebox[:compute], {:image_id => 'a00baa8f-b5d0-4815-8238-b471c4c4bf72'}, false)
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Bluebox::Compute | servers collection', ['bluebox']) do
# Ubuntu 9.10 64bit
servers_tests(Bluebox[:compute], {:image_id => 'a00baa8f-b5d0-4815-8238-b471c4c4bf72'}, false)
end

View File

@ -1,5 +0,0 @@
Shindo.tests('Brightbox::Compute | flavors collection', ['brightbox']) do
flavors_tests(Brightbox[:compute], {}, false)
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Brightbox::Compute | server model', ['brightbox']) do
image_id = Brightbox::Compute::TestSupport::IMAGE_IDENTIFER
server_tests(Brightbox[:compute], {:image_id => image_id}, false)
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Brightbox::Compute | servers collection', ['brightbox']) do
image_id = Brightbox::Compute::TestSupport::IMAGE_IDENTIFER
servers_tests(Brightbox[:compute], {:image_id => image_id}, false)
end

36
tests/compute/helper.rb Normal file
View File

@ -0,0 +1,36 @@
def compute_providers
{
AWS => {
:server_attributes => {
:image_id => 'ami-1a837773' # image ami-1a837773 = Ubuntu
},
:mocked => true
},
Bluebox => {
:server_attributes => {
:image_id => 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
},
:mocked => false
},
Brightbox => {
:server_attributes => {
:image_id => 'img-9vxqi' # image img-9vxqi = Ubuntu Maverick 10.10 server
},
:mocked => false
},
Rackspace => {
:server_attributes => {
:image_id => 49, # image 49 = Ubuntu 10.04 LTS (lucid)
:name => "fog_#{Time.now.to_i}"
},
:mocked => true
},
Slicehost => {
:server_attributes => {
:image_id => 49, # image 49 = Ubuntu 10.04 LTS (lucid)
:name => "fog_#{Time.now.to_i}"
},
:mocked => false
}
}
end

View File

@ -0,0 +1,9 @@
for provider, config in compute_providers
Shindo.tests("#{provider}::Compute | flavors", [provider.to_s.downcase]) do
flavors_tests(provider[:compute], (config[:flavors_attributes] || {}), config[:mocked])
end
end

View File

@ -0,0 +1,9 @@
for provider, config in compute_providers
Shindo.tests("#{provider}::Compute | server", [provider.to_s.downcase]) do
server_tests(provider[:compute], (config[:server_attributes] || {}), config[:mocked])
end
end

View File

@ -0,0 +1,9 @@
for provider, config in compute_providers
Shindo.tests("#{provider}::Compute | servers", [provider.to_s.downcase]) do
servers_tests(provider[:compute], (config[:server_attributes] || {}), config[:mocked])
end
end

View File

@ -1,5 +0,0 @@
Shindo.tests('Rackspace::Compute | flavors collection', ['rackspace']) do
flavors_tests(Rackspace[:compute], {}, false)
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Rackspace::Compute | server model', ['rackspace']) do
# image 49 = Ubuntu 10.04 LTS (lucid)
server_tests(Rackspace[:compute], {:image_id => 49, :name => "fog_#{Time.now.to_i}"})
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Rackspace::Compute | servers collection', ['rackspace']) do
# image 49 = Ubuntu 10.04 LTS (lucid)
servers_tests(Rackspace[:compute], {:image_id => 49, :name => "fog_#{Time.now.to_i}"})
end

View File

@ -1 +0,0 @@

View File

@ -1,5 +0,0 @@
Shindo.tests('Slicehost::Compute | flavors collection', ['slicehost']) do
flavors_tests(Slicehost[:compute], {}, false)
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Slicehost::Compute | server model', ['slicehost']) do
# image 49 = Ubuntu 10.04 LTS (lucid)
server_tests(Slicehost[:compute], {:image_id => 49, :name => "fog_#{Time.now.to_i}"}, false)
end

View File

@ -1,6 +0,0 @@
Shindo.tests('Slicehost::Compute | servers collection', ['slicehost']) do
# image 49 = Ubuntu 10.04 LTS (lucid)
servers_tests(Slicehost[:compute], {:image_id => 49, :name => "fog_#{Time.now.to_i}"}, false)
end