2013-01-18 15:06:41 -05:00
|
|
|
Shindo.tests("Fog::Compute[:hp] | address requests", ['hp']) do
|
2012-04-05 16:07:57 -04:00
|
|
|
|
2012-04-26 16:49:42 -04:00
|
|
|
@base_image_id = ENV["BASE_IMAGE_ID"] || 1242
|
2012-04-10 18:11:56 -04:00
|
|
|
|
2012-04-05 16:07:57 -04:00
|
|
|
tests('success') do
|
2012-04-10 18:11:56 -04:00
|
|
|
@server = Fog::Compute[:hp].servers.create(:name => 'fogaddresstests', :flavor_id => 100, :image_id => @base_image_id)
|
2012-04-11 12:39:13 -04:00
|
|
|
@server.wait_for { ready? }
|
|
|
|
@address = Fog::Compute[:hp].addresses.create
|
|
|
|
@address.server = @server
|
2012-04-05 16:07:57 -04:00
|
|
|
|
|
|
|
# the network name is currently named 'private'
|
2012-04-11 12:39:13 -04:00
|
|
|
tests("#list_server_addresses(#{@server.id})").formats({'addresses' => {"private" => [{'version' => Integer, 'addr' => String}]}}) do
|
2012-04-05 16:07:57 -04:00
|
|
|
Fog::Compute[:hp].list_server_addresses(@server.id).body
|
|
|
|
end
|
|
|
|
|
2012-04-11 12:39:13 -04:00
|
|
|
tests("#list_server_private_addresses(#{@server.id}, 'private')").formats({'private' => [{'version' => Integer, 'addr' => String}]}) do
|
2012-04-05 16:07:57 -04:00
|
|
|
Fog::Compute[:hp].list_server_private_addresses(@server.id, 'private').body
|
|
|
|
end
|
|
|
|
|
2012-04-11 12:39:13 -04:00
|
|
|
tests("#list_server_public_addresses(#{@server.id}, 'private')").formats({'public' => [{'version' => Integer, 'addr' => String}]}) do
|
2012-04-05 16:07:57 -04:00
|
|
|
Fog::Compute[:hp].list_server_public_addresses(@server.id, 'private').body
|
|
|
|
end
|
|
|
|
|
2012-04-11 12:39:13 -04:00
|
|
|
@address.destroy
|
2012-04-05 16:07:57 -04:00
|
|
|
@server.destroy
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests("#list_server_addresses(0)").raises(Fog::Compute::HP::NotFound) do
|
|
|
|
Fog::Compute[:hp].list_server_addresses(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_server_private_addresses(0, 'private')").raises(Fog::Compute::HP::NotFound) do
|
|
|
|
Fog::Compute[:hp].list_server_private_addresses(0, 'private')
|
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_server_public_addresses(0, 'private')").raises(Fog::Compute::HP::NotFound) do
|
|
|
|
Fog::Compute[:hp].list_server_public_addresses(0, 'private')
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|