2012-09-04 20:18:49 -04:00
|
|
|
Shindo.tests('Fog::Rackspace::BlockStorage | volume', ['rackspace']) do
|
|
|
|
|
|
|
|
service = Fog::Rackspace::BlockStorage.new
|
|
|
|
options = { :display_name => "fog_#{Time.now.to_i.to_s}", :size => 100 }
|
|
|
|
|
2013-01-11 16:06:58 -05:00
|
|
|
model_tests(service.volumes, options, true) do
|
2012-12-20 10:15:56 -05:00
|
|
|
@instance.wait_for(timeout=1200) { ready? }
|
|
|
|
|
2012-12-20 12:33:43 -05:00
|
|
|
tests('double save').raises(Fog::Rackspace::BlockStorage::IdentifierTaken) do
|
2012-12-20 10:15:56 -05:00
|
|
|
@instance.save
|
|
|
|
end
|
2012-09-04 20:18:49 -04:00
|
|
|
|
|
|
|
tests('#attached?').succeeds do
|
|
|
|
@instance.state = 'in-use'
|
|
|
|
returns(true) { @instance.attached? }
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('#snapshots').succeeds do
|
2012-12-20 10:15:56 -05:00
|
|
|
begin
|
2012-12-19 17:32:23 -05:00
|
|
|
snapshot = @instance.create_snapshot
|
|
|
|
snapshot.wait_for(timeout=1200) { ready? }
|
2012-12-20 10:15:56 -05:00
|
|
|
|
|
|
|
returns(true) { @instance.snapshots.first.id == snapshot.id }
|
|
|
|
ensure
|
|
|
|
snapshot.destroy if snapshot
|
|
|
|
end
|
2012-09-04 20:18:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
@instance.wait_for { snapshots.empty? }
|
|
|
|
end
|
|
|
|
end
|