2011-06-22 18:08:38 -04:00
|
|
|
Shindo.tests('Fog::Compute[:ninefold] | address requests', ['ninefold']) do
|
2011-05-11 13:59:56 -04:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
tests("#associate_ip_address()").formats(Ninefold::Compute::Formats::Addresses::ADDRESS) do
|
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
job = newaddress = Fog::Compute[:ninefold].associate_ip_address(:zoneid => Ninefold::Compute::TestSupport::ZONE_ID)
|
|
|
|
while Fog::Compute[:ninefold].query_async_job_result(:jobid => job['jobid'])['jobstatus'] == 0
|
2011-05-11 13:59:56 -04:00
|
|
|
sleep 1
|
|
|
|
end
|
2011-06-16 19:28:54 -04:00
|
|
|
result = Fog::Compute[:ninefold].query_async_job_result(:jobid => job['jobid'])['jobresult']['ipaddress']
|
2011-05-11 13:59:56 -04:00
|
|
|
@newaddressid = result['id']
|
2011-06-22 18:08:38 -04:00
|
|
|
result
|
2011-05-11 13:59:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_public_ip_addresses()").formats(Ninefold::Compute::Formats::Addresses::ADDRESSES) do
|
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
result = Fog::Compute[:ninefold].list_public_ip_addresses
|
2011-06-22 18:08:38 -04:00
|
|
|
result
|
2011-05-11 13:59:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#disassociate_ip_address()").formats(Ninefold::Compute::Formats::Addresses::DISASSOC_ADDRESS) do
|
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
job = Fog::Compute[:ninefold].disassociate_ip_address(:id => @newaddressid)
|
|
|
|
while Fog::Compute[:ninefold].query_async_job_result(:jobid => job['jobid'])['jobstatus'] == 0
|
2011-05-11 13:59:56 -04:00
|
|
|
sleep 1
|
|
|
|
end
|
|
|
|
job
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
tests("#associate_ip_address()").raises(Excon::Errors::HTTPStatusError) do
|
|
|
|
pending if Fog.mocking?
|
2011-06-16 19:28:54 -04:00
|
|
|
Fog::Compute[:ninefold].associate_ip_address
|
2011-05-11 13:59:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|