2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests('Fog::Compute[:rackspace] | address requests', ['rackspace']) do
|
2010-09-09 20:50:38 -04:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
@server = Fog::Compute[:rackspace].servers.create(:flavor_id => 1, :image_id => 19)
|
2010-09-09 20:50:38 -04:00
|
|
|
|
|
|
|
tests("#list_addresses(#{@server.id})").formats({'addresses' => {'private' => [String], 'public' => [String]}}) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:rackspace].list_addresses(@server.id).body
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_private_addresses(#{@server.id})").formats({'private' => [String]}) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:rackspace].list_private_addresses(@server.id).body
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_public_addresses(#{@server.id})").formats({'public' => [String]}) do
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:rackspace].list_public_addresses(@server.id).body
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
@server.wait_for { ready? }
|
|
|
|
@server.destroy
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests('#list_addresses(0)').raises(Fog::Compute::Rackspace::NotFound) do
|
|
|
|
Fog::Compute[:rackspace].list_addresses(0)
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests('#list_private_addresses(0)').raises(Fog::Compute::Rackspace::NotFound) do
|
|
|
|
Fog::Compute[:rackspace].list_private_addresses(0)
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
tests('#list_public_addresses(0)').raises(Fog::Compute::Rackspace::NotFound) do
|
|
|
|
Fog::Compute[:rackspace].list_public_addresses(0)
|
2010-09-09 20:50:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|