mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute] consolidate testing
This commit is contained in:
parent
7dbe810fd1
commit
ed153088d0
63 changed files with 63 additions and 85 deletions
|
|
@ -1,17 +0,0 @@
|
|||
class Bluebox
|
||||
|
||||
module Compute
|
||||
|
||||
module Formats
|
||||
|
||||
PRODUCT = {
|
||||
'cost' => Float,
|
||||
'description' => String,
|
||||
'id' => String
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
Shindo.tests('Bluebox::Compute | flavors collection', ['bluebox']) do
|
||||
|
||||
flavors_tests(Bluebox[:compute], {}, false)
|
||||
|
||||
end
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
|
||||
|
||||
@block_format = {
|
||||
'cpu' => Float,
|
||||
'description' => String,
|
||||
'hostname' => String,
|
||||
'id' => String,
|
||||
'ips' => [{'address' => String}],
|
||||
'memory' => Integer,
|
||||
'product' => Bluebox::Compute::Formats::PRODUCT,
|
||||
'status' => String,
|
||||
'storage' => Integer,
|
||||
'template' => String
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
|
||||
@product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB
|
||||
@template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
|
||||
@password = 'chunkybacon'
|
||||
|
||||
@block_id = nil
|
||||
|
||||
tests("create_block('#{@product_id}', '#{@template_id}', 'password' => '#{@password}')").formats(@block_format) do
|
||||
pending if Fog.mocking?
|
||||
data = Bluebox[:compute].create_block(@product_id, @template_id, 'password' => @password).body
|
||||
@block_id = data['id']
|
||||
data
|
||||
end
|
||||
|
||||
unless Fog.mocking?
|
||||
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("get_block('#{@block_id}')").formats(@block_format) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_block(@block_id).body
|
||||
end
|
||||
|
||||
tests("get_blocks").formats([@block_format.reject {|key,value| ['product', 'template'].include?(key)}]) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_blocks.body
|
||||
end
|
||||
|
||||
tests("reboot_block('#{@block_id}')").formats({'status' => String, 'text' => String}) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].reboot_block(@block_id).body
|
||||
end
|
||||
|
||||
unless Fog.mocking?
|
||||
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
||||
end
|
||||
|
||||
tests("destroy_block('#{@block_id})'").formats({'text' => String}) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].destroy_block(@block_id).body
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
|
||||
tests("get_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_block('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
tests("reboot_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].reboot_block('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
tests("destroy_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].destroy_block('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
Shindo.tests('Bluebox::Compute | product requests', ['bluebox']) do
|
||||
|
||||
tests('success') do
|
||||
|
||||
@product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB
|
||||
|
||||
tests("get_product('#{@product_id}')").formats(Bluebox::Compute::Formats::PRODUCT) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_product(@product_id).body
|
||||
end
|
||||
|
||||
tests("get_products").formats([Bluebox::Compute::Formats::PRODUCT]) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_products.body
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
|
||||
tests("get_product('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_product('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
Shindo.tests('Bluebox::Compute | template requests', ['bluebox']) do
|
||||
|
||||
@template_format = {
|
||||
'created' => String,
|
||||
'description' => String,
|
||||
'id' => String,
|
||||
'public' => Fog::Boolean
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
|
||||
@template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
|
||||
|
||||
tests("get_template('#{@template_id}')").formats(@template_format) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_template(@template_id).body
|
||||
end
|
||||
|
||||
tests("get_templates").formats([@template_format]) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_templates.body
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
tests('failure') do
|
||||
|
||||
tests("get_template('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
||||
pending if Fog.mocking?
|
||||
Bluebox[:compute].get_template('00000000-0000-0000-0000-000000000000')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue