2013-01-11 16:06:58 -05:00
|
|
|
service = Fog::Rackspace::BlockStorage.new
|
2012-09-04 20:18:41 -04:00
|
|
|
|
2013-01-11 16:06:58 -05:00
|
|
|
Shindo.tests('Fog::Rackspace::BlockStorage | snapshot', ['rackspace']) do
|
2012-09-04 20:18:41 -04:00
|
|
|
|
2012-12-20 10:15:56 -05:00
|
|
|
begin
|
|
|
|
volume = service.volumes.create({
|
|
|
|
:display_name => "fog_#{Time.now.to_i.to_s}",
|
|
|
|
:size => 100
|
|
|
|
})
|
2012-09-04 20:18:41 -04:00
|
|
|
|
2012-12-20 10:15:56 -05:00
|
|
|
volume.wait_for { ready? }
|
2012-09-04 20:18:41 -04:00
|
|
|
|
2012-12-20 10:15:56 -05:00
|
|
|
options = { :display_name => "fog_#{Time.now.to_i.to_s}", :volume_id => volume.id }
|
2013-01-11 16:06:58 -05:00
|
|
|
model_tests(service.snapshots, options, true) do
|
2012-12-20 10:15:56 -05:00
|
|
|
@instance.wait_for { ready? }
|
2013-01-11 16:06:58 -05:00
|
|
|
|
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
|
2013-01-11 16:06:58 -05:00
|
|
|
end
|
2012-12-20 10:15:56 -05:00
|
|
|
end
|
2012-09-04 20:18:41 -04:00
|
|
|
|
2012-12-20 10:15:56 -05:00
|
|
|
volume.wait_for { snapshots.empty? }
|
|
|
|
ensure
|
|
|
|
volume.destroy if volume
|
|
|
|
end
|
2012-09-04 20:18:41 -04:00
|
|
|
end
|