1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

minor fix to ENI tests

This commit is contained in:
Eric Stonfer 2012-04-01 22:29:36 -04:00
parent 935c63447b
commit e27c195dd6
2 changed files with 9 additions and 5 deletions

View file

@ -28,7 +28,7 @@ module Fog
end
class Mock
def detach_network_interface(attachment_id)
def detach_network_interface(attachment_id, force = false)
response = Excon::Response.new
nic_id = self.data[:network_interfaces].select { |k,v| v['attachment']['attachmentId'] == attachment_id} .first.first
if nic_id

View file

@ -130,7 +130,9 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do
tests('#detach_network_interface').returns(true) do
Fog::Compute[:aws].detach_network_interface(@attachment_id,true).body["return"]
end
Fog::Compute[:aws].network_interfaces.get(@nic_id).wait_for { status == 'available'}
if !Fog.mocking?
Fog::Compute[:aws].network_interfaces.get(@nic_id).wait_for { status == 'available'}
end
# Create network interface with arguments
options = {
"PrivateIpAddress" => "10.0.10.24",
@ -161,9 +163,11 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do
# Clean up resources
@server.destroy
@server.wait_for { state == 'terminated' }
# despite the fact that the state goes to 'terminated' we need a little delay for aws to do its thing
sleep 5
if !Fog.mocking?
@server.wait_for { state == 'terminated' }
# despite the fact that the state goes to 'terminated' we need a little delay for aws to do its thing
sleep 5
end
@security_group.destroy
@subnet.destroy
@vpc.destroy