diff --git a/tests/hp/requests/compute/address_tests.rb b/tests/hp/requests/compute/address_tests.rb index 31777f5e8..4e2f3cd3f 100644 --- a/tests/hp/requests/compute/address_tests.rb +++ b/tests/hp/requests/compute/address_tests.rb @@ -20,11 +20,19 @@ Shindo.tests('Fog::Compute[:hp] | address requests', ['hp']) do data end + tests("#get_address('#{@address_id}')").formats(@floating_ips_format) do + Fog::Compute[:hp].get_address(@address_id).body['floating_ip'] + end + @server = Fog::Compute[:hp].servers.create(:name => 'fogaddresstests', :flavor_id => 100, :image_id => 1242) @server.wait_for { ready? } tests("#associate_address('#{@server.id}', '#{@ip_address}')").succeeds do Fog::Compute[:hp].associate_address(@server.id, @ip_address) + tests("#get_address").returns(@server.id, "associated to valid instance id") do + pending if Fog.mocking? + Fog::Compute[:hp].get_address(@address_id).body['floating_ip']['instance_id'].to_s + end end tests("#disassociate_address('#{@server.id}', '#{@ip_address}')").succeeds do @@ -41,6 +49,10 @@ Shindo.tests('Fog::Compute[:hp] | address requests', ['hp']) do tests('failure') do + tests("#get_address('invalidaddress', 'invalidip')").raises(Fog::Compute::HP::NotFound) do + Fog::Compute[:hp].get_address('invalidaddress') + end + tests("#associate_address('invalidserver', 'invalidip')").raises(Fog::Compute::HP::NotFound) do Fog::Compute[:hp].associate_address('invalidserver', 'invalidip') end @@ -49,8 +61,8 @@ Shindo.tests('Fog::Compute[:hp] | address requests', ['hp']) do Fog::Compute[:hp].disassociate_address('invalidserver', 'invalidip') end - tests("#release_address('invalidip')").raises(Fog::Compute::HP::NotFound) do - Fog::Compute[:hp].release_address('invalidip') + tests("#release_address('invalidaddress')").raises(Fog::Compute::HP::NotFound) do + Fog::Compute[:hp].release_address('invalidaddress') end end