diff --git a/tests/bluebox/requests/compute/block_tests.rb b/tests/bluebox/requests/compute/block_tests.rb index 44c2a2ae5..a3417568e 100644 --- a/tests/bluebox/requests/compute/block_tests.rb +++ b/tests/bluebox/requests/compute/block_tests.rb @@ -8,23 +8,24 @@ Shindo.tests('Fog::Compute[:bluebox] | block requests', ['bluebox']) do 'ips' => [{'address' => String}], 'lb_applications' => [], 'memory' => Integer, - 'product' => Bluebox::Compute::Formats::PRODUCT, + 'product' => {'cost' => String, 'description' => String, 'id' => String}, 'status' => String, 'storage' => Integer, - 'template' => String + 'location_id' => String } tests('success') do - @product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB - @template_id = compute_providers[:bluebox][:server_attributes][:image_id] - @password = 'chunkybacon' + @flavor_id = compute_providers[:bluebox][:server_attributes][:flavor_id] + @image_id = compute_providers[:bluebox][:server_attributes][:image_id] + @location_id = compute_providers[:bluebox][:server_attributes][:location_id] + @password = compute_providers[:bluebox][:server_attributes][:password] @block_id = nil - tests("create_block('#{@product_id}', '#{@template_id}', {'password' => '#{@password}'})").formats(@block_format.merge('add_to_lb_application_results' => {'text' => String})) do + tests("create_block('#{@flavor_id}', '#{@image_id}', '#{@location_id}', {'password' => '#{@password}'})").formats(@block_format.merge('add_to_lb_application_results' => {'text' => String})) do pending if Fog.mocking? - data = Fog::Compute[:bluebox].create_block(@product_id, @template_id, {'password' => @password}).body + data = Fog::Compute[:bluebox].create_block(@flavor_id, @image_id, @location_id, {'password' => @password}).body @block_id = data['id'] data end @@ -43,7 +44,7 @@ Shindo.tests('Fog::Compute[:bluebox] | block requests', ['bluebox']) do Fog::Compute[:bluebox].get_blocks.body end - tests("reboot_block('#{@block_id}')").formats({'status' => String, 'text' => String}) do + tests("reboot_block('#{@block_id}')").formats([{'status' => String}, {'text' => String}]) do pending if Fog.mocking? Fog::Compute[:bluebox].reboot_block(@block_id).body end diff --git a/tests/bluebox/requests/compute/helper.rb b/tests/bluebox/requests/compute/helper.rb index 2d4becbfe..990929d38 100644 --- a/tests/bluebox/requests/compute/helper.rb +++ b/tests/bluebox/requests/compute/helper.rb @@ -8,6 +8,11 @@ class Bluebox 'cost' => String, 'description' => String, 'id' => String + }, + + LOCATION = { + 'id' => String, + 'description' => String } end diff --git a/tests/bluebox/requests/compute/location_tests.rb b/tests/bluebox/requests/compute/location_tests.rb new file mode 100644 index 000000000..7182df534 --- /dev/null +++ b/tests/bluebox/requests/compute/location_tests.rb @@ -0,0 +1,32 @@ +Shindo.tests('Fog::Compute[:bluebox] | location requests', ['bluebox']) do + + @location_format = { + 'id' => String, + 'description' => String + } + + tests('success') do + + @location_id = compute_providers[:bluebox][:server_attributes][:location_id] + + tests("get_location('#{@product_id}')").formats(@location_format) do + pending if Fog.mocking? + Fog::Compute[:bluebox].get_location(@location_id).body + end + + tests("get_locations").formats([@location_format]) do + pending if Fog.mocking? + Fog::Compute[:bluebox].get_locations.body + end + + end + + tests('failure') do + + tests("get_location('00000000-0000-0000-0000-000000000000')").raises(Fog::Compute::Bluebox::NotFound) do + pending if Fog.mocking? + Fog::Compute[:bluebox].get_location('00000000-0000-0000-0000-000000000000') + end + + end +end \ No newline at end of file diff --git a/tests/bluebox/requests/compute/product_tests.rb b/tests/bluebox/requests/compute/product_tests.rb index 5b5332404..908931fea 100644 --- a/tests/bluebox/requests/compute/product_tests.rb +++ b/tests/bluebox/requests/compute/product_tests.rb @@ -1,15 +1,21 @@ Shindo.tests('Fog::Compute[:bluebox] | product requests', ['bluebox']) do + @product_format = { + 'id' => String, + 'description' => String, + 'cost' => String + } + tests('success') do - @product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB + @flavor_id = compute_providers[:bluebox][:server_attributes][:flavor_id] - tests("get_product('#{@product_id}')").formats(Bluebox::Compute::Formats::PRODUCT) do + tests("get_product('#{@flavor_id}')").formats(@product_format) do pending if Fog.mocking? - Fog::Compute[:bluebox].get_product(@product_id).body + Fog::Compute[:bluebox].get_product(@flavor_id).body end - tests("get_products").formats([Bluebox::Compute::Formats::PRODUCT]) do + tests("get_products").formats([@product_format]) do pending if Fog.mocking? Fog::Compute[:bluebox].get_products.body end diff --git a/tests/bluebox/requests/compute/template_tests.rb b/tests/bluebox/requests/compute/template_tests.rb index ca55128cd..17da4f7a5 100644 --- a/tests/bluebox/requests/compute/template_tests.rb +++ b/tests/bluebox/requests/compute/template_tests.rb @@ -4,12 +4,14 @@ Shindo.tests('Fog::Compute[:bluebox] | template requests', ['bluebox']) do 'created' => String, 'description' => String, 'id' => String, - 'public' => Fog::Boolean + 'public' => Fog::Boolean, + 'locations' => [ String ], + 'status' => String } tests('success') do - @template_id = '03807e08-a13d-44e4-b011-ebec7ef2c928' # Ubuntu LTS 10.04 64bit + @template_id = compute_providers[:bluebox][:server_attributes][:image_id] tests("get_template('#{@template_id}')").formats(@template_format) do pending if Fog.mocking? diff --git a/tests/compute/helper.rb b/tests/compute/helper.rb index 53b8f69a8..6ea9ea285 100644 --- a/tests/compute/helper.rb +++ b/tests/compute/helper.rb @@ -6,8 +6,10 @@ def compute_providers }, :bluebox => { :server_attributes => { - :image_id => '03807e08-a13d-44e4-b011-ebec7ef2c928', # Ubuntu 10.04 64bit - :password => 'chunkybacon' + :flavor_id => '94fd37a7-2606-47f7-84d5-9000deda52ae', # Block 1GB Virtual Server + :image_id => 'a8f05200-7638-47d1-8282-2474ef57c4c3', # Scientific Linux 6 + :location_id => '37c2bd9a-3e81-46c9-b6e2-db44a25cc675', # Seattle, WA + :password => 'chunkybacon' }, :mocked => false },