2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests("Fog::Compute[:aws] | volume", ['aws']) do
|
2011-03-21 19:45:52 -04:00
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
@server = Fog::Compute[:aws].servers.create
|
2011-03-21 19:45:52 -04:00
|
|
|
@server.wait_for { ready? }
|
|
|
|
|
2012-04-04 10:48:55 -04:00
|
|
|
model_tests(Fog::Compute[:aws].volumes, {:availability_zone => @server.availability_zone, :size => 1, :device => '/dev/sdz1', :tags => {"key" => "value"}}, true) do
|
2011-04-04 17:57:13 -04:00
|
|
|
|
|
|
|
@instance.wait_for { ready? }
|
2011-04-27 16:19:19 -04:00
|
|
|
|
2011-03-21 19:45:52 -04:00
|
|
|
tests('#server = @server').succeeds do
|
|
|
|
@instance.server = @server
|
|
|
|
end
|
|
|
|
|
|
|
|
@instance.wait_for { state == 'in-use' }
|
|
|
|
|
2011-06-28 17:25:29 -04:00
|
|
|
tests('#server').succeeds do
|
|
|
|
@instance.server
|
|
|
|
end
|
|
|
|
|
2011-03-21 19:45:52 -04:00
|
|
|
tests('#server = nil').succeeds do
|
2012-06-29 08:30:40 -04:00
|
|
|
(@instance.server = nil).nil?
|
2011-03-21 19:45:52 -04:00
|
|
|
end
|
|
|
|
|
2011-07-08 17:31:29 -04:00
|
|
|
@instance.wait_for { ready? }
|
|
|
|
|
2011-06-27 19:39:15 -04:00
|
|
|
@instance.server = @server
|
|
|
|
@instance.wait_for { state == 'in-use' }
|
|
|
|
|
|
|
|
tests('#force_detach').succeeds do
|
|
|
|
@instance.force_detach
|
|
|
|
end
|
|
|
|
|
2011-03-21 19:45:52 -04:00
|
|
|
@instance.wait_for { ready? }
|
|
|
|
|
2012-04-04 10:48:55 -04:00
|
|
|
tests('@instance.reload.tags').returns({'key' => 'value'}) do
|
|
|
|
@instance.reload.tags
|
|
|
|
end
|
|
|
|
|
2011-03-21 19:45:52 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
@server.destroy
|
|
|
|
|
2011-04-27 16:19:19 -04:00
|
|
|
end
|