1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/aws/models/compute/volume_tests.rb
Dan Carley 8fa64aefbf [compute|aws] Apply tags to volume at creation
Same approach as used for server tags for issue #366
2012-04-04 18:18:51 +01:00

43 lines
967 B
Ruby

Shindo.tests("Fog::Compute[:aws] | volume", ['aws']) do
@server = Fog::Compute[:aws].servers.create
@server.wait_for { ready? }
model_tests(Fog::Compute[:aws].volumes, {:availability_zone => @server.availability_zone, :size => 1, :device => '/dev/sdz1', :tags => {"key" => "value"}}, true) do
@instance.wait_for { ready? }
tests('#server = @server').succeeds do
@instance.server = @server
end
@instance.wait_for { state == 'in-use' }
tests('#server').succeeds do
@instance.server
end
tests('#server = nil').succeeds do
@instance.server = nil
end
@instance.wait_for { ready? }
@instance.server = @server
@instance.wait_for { state == 'in-use' }
tests('#force_detach').succeeds do
@instance.force_detach
end
@instance.wait_for { ready? }
tests('@instance.reload.tags').returns({'key' => 'value'}) do
@instance.reload.tags
end
end
@server.destroy
end