2011-06-16 19:28:54 -04:00
|
|
|
Shindo.tests('Fog::Compute[:rackspace] | resize request', ['rackspace']) do
|
2010-11-29 13:36:10 -05:00
|
|
|
|
2012-12-20 15:00:13 -05:00
|
|
|
@service = Fog::Compute.new(:provider => :rackspace, :version => :v1)
|
2010-11-29 13:36:10 -05:00
|
|
|
|
2012-12-20 15:00:13 -05:00
|
|
|
@confirm_server = @service.servers.create(:flavor_id => 1, :image_id => 19)
|
|
|
|
|
|
|
|
@revert_server = @service.servers.create(:flavor_id => 1, :image_id => 19)
|
2010-11-29 13:36:10 -05:00
|
|
|
|
2011-01-04 14:18:29 -05:00
|
|
|
@confirm_server.wait_for { ready? }
|
|
|
|
tests("#resize_server(#{@confirm_server.id}, 2) # to confirm").succeeds do
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.resize_server(@confirm_server.id, 2)
|
2010-11-29 13:36:10 -05:00
|
|
|
end
|
|
|
|
|
2011-01-04 14:18:29 -05:00
|
|
|
@revert_server.wait_for { ready? }
|
|
|
|
tests("#resize_server(#{@revert_server.id}, 2) # to revert").succeeds do
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.resize_server(@revert_server.id, 2)
|
2010-11-29 13:36:10 -05:00
|
|
|
end
|
|
|
|
|
2011-05-24 17:59:48 -04:00
|
|
|
@confirm_server.wait_for { state == 'VERIFY_RESIZE' }
|
2011-01-04 14:18:29 -05:00
|
|
|
tests("#confirm_resized_server(#{@confirm_server.id})").succeeds do
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.confirm_resized_server(@confirm_server.id)
|
2010-11-29 13:36:10 -05:00
|
|
|
end
|
|
|
|
|
2011-05-24 17:59:48 -04:00
|
|
|
@revert_server.wait_for { state == 'VERIFY_RESIZE' }
|
2011-01-04 14:18:29 -05:00
|
|
|
tests("#revert_resized_server(#{@revert_server.id})").succeeds do
|
2012-12-20 15:00:13 -05:00
|
|
|
@service.revert_resized_server(@revert_server.id)
|
2010-11-29 13:36:10 -05:00
|
|
|
end
|
|
|
|
|
2011-01-04 14:18:29 -05:00
|
|
|
@confirm_server.wait_for { ready? }
|
|
|
|
@confirm_server.destroy
|
2010-11-29 13:36:10 -05:00
|
|
|
|
2011-01-04 14:18:29 -05:00
|
|
|
@revert_server.wait_for { ready? }
|
|
|
|
@revert_server.destroy
|
2010-11-29 13:36:10 -05:00
|
|
|
|
|
|
|
end
|