Test tweaks

This commit is contained in:
ggoodale 2011-02-22 17:08:56 -08:00 committed by geemus
parent fc18e38dea
commit 9fb34868d2
2 changed files with 66 additions and 66 deletions

View File

@ -14,66 +14,66 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
} }
tests('success') do tests('success') do
#
# @product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB @product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB
# @template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit @template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
# @password = 'chunkybacon' @password = 'chunkybacon'
#
# @block_id = nil @block_id = nil
#
# tests("create_block('#{@product_id}', '#{@template_id}', 'password' => '#{@password}')").formats(@block_format) do tests("create_block('#{@product_id}', '#{@template_id}', 'password' => '#{@password}')").formats(@block_format) do
# pending if Fog.mocking? pending if Fog.mocking?
# data = Bluebox[:compute].create_block(@product_id, @template_id, 'password' => @password).body data = Bluebox[:compute].create_block(@product_id, @template_id, 'password' => @password).body
# @block_id = data['id'] @block_id = data['id']
# data data
# end end
#
# unless Fog.mocking? unless Fog.mocking?
# Bluebox[:compute].servers.get(@block_id).wait_for { ready? } Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
# end end
#
# tests("get_block('#{@block_id}')").formats(@block_format) do tests("get_block('#{@block_id}')").formats(@block_format) do
# pending if Fog.mocking? pending if Fog.mocking?
# Bluebox[:compute].get_block(@block_id).body Bluebox[:compute].get_block(@block_id).body
# end end
#
# tests("get_blocks").formats([@block_format.reject {|key,value| ['product', 'template'].include?(key)}]) do tests("get_blocks").formats([@block_format.reject {|key,value| ['product', 'template'].include?(key)}]) do
# pending if Fog.mocking? pending if Fog.mocking?
# Bluebox[:compute].get_blocks.body Bluebox[:compute].get_blocks.body
# end 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? pending if Fog.mocking?
# Bluebox[:compute].reboot_block(@block_id).body Bluebox[:compute].reboot_block(@block_id).body
# end end
#
# unless Fog.mocking? unless Fog.mocking?
# Bluebox[:compute].servers.get(@block_id).wait_for { ready? } Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
# end end
#
# tests("destroy_block('#{@block_id})'").formats({'text' => String}) do tests("destroy_block('#{@block_id})'").formats({'text' => String}) do
# pending if Fog.mocking? pending if Fog.mocking?
# Bluebox[:compute].destroy_block(@block_id).body Bluebox[:compute].destroy_block(@block_id).body
# end end
#
# end end
#
# tests('failure') do tests('failure') do
#
# tests("get_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do tests("get_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
# pending if Fog.mocking? pending if Fog.mocking?
# Bluebox[:compute].get_block('00000000-0000-0000-0000-000000000000') Bluebox[:compute].get_block('00000000-0000-0000-0000-000000000000')
# end end
#
# tests("reboot_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do tests("reboot_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
# pending if Fog.mocking? pending if Fog.mocking?
# Bluebox[:compute].reboot_block('00000000-0000-0000-0000-000000000000') Bluebox[:compute].reboot_block('00000000-0000-0000-0000-000000000000')
# end end
#
# tests("destroy_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do tests("destroy_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
# pending if Fog.mocking? pending if Fog.mocking?
# Bluebox[:compute].destroy_block('00000000-0000-0000-0000-000000000000') Bluebox[:compute].destroy_block('00000000-0000-0000-0000-000000000000')
# end end
end end

View File

@ -186,9 +186,9 @@ Shindo.tests('Bluebox::dns | DNS requests', ['bluebox', 'dns']) do
response = Bluebox[:dns].get_record(@new_zones[1], @record_id) response = Bluebox[:dns].get_record(@new_zones[1], @record_id)
if response.status == 200 if response.status == 200
mail_domain = 'mail.' + @domain mail_domain = 'mail.' + @domain + "."
record = response.body['records'][0] record = response.body
if (record['type'] == 'MX') and (record['name'] == @domain) and (record['content'] == mail_domain) and (record['priority'] == 10) if (record['type'] == 'MX') and (record['name'] == @domain) and (record['content'] == mail_domain) and (record['priority'] == '10')
result= true result= true
end end
end end
@ -201,7 +201,7 @@ Shindo.tests('Bluebox::dns | DNS requests', ['bluebox', 'dns']) do
result= false result= false
response = Bluebox[:dns].get_records() response = Bluebox[:dns].get_records(@new_zones[1])
if response.status == 200 if response.status == 200
records = response.body['records'] records = response.body['records']
@ -209,8 +209,8 @@ Shindo.tests('Bluebox::dns | DNS requests', ['bluebox', 'dns']) do
records.each {|record| records.each {|record|
if record['type'] == 'MX' if record['type'] == 'MX'
mail_domain = 'mail.' + @domain mail_domain = 'mail.' + @domain + "."
if (record['type'] == 'MX') and (record['name'] == @domain) and (record['content'] == mail_domain) and (record['priority'] == 10) if (record['type'] == 'MX') and (record['name'] == @domain) and (record['content'] == mail_domain) and (record['priority'] == '10')
result= true result= true
break break
end end