1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/requests/compute/resize_tests.rb

36 lines
1.2 KiB
Ruby
Raw Normal View History

Shindo.tests('Fog::Compute[:rackspace] | resize request', ['rackspace']) do
2010-11-29 13:36:10 -05:00
@service = Fog::Compute.new(:provider => :rackspace, :version => :v1)
2010-11-29 13:36:10 -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
@confirm_server.wait_for { ready? }
tests("#resize_server(#{@confirm_server.id}, 2) # to confirm").succeeds do
@service.resize_server(@confirm_server.id, 2)
2010-11-29 13:36:10 -05:00
end
@revert_server.wait_for { ready? }
tests("#resize_server(#{@revert_server.id}, 2) # to revert").succeeds do
@service.resize_server(@revert_server.id, 2)
2010-11-29 13:36:10 -05:00
end
@confirm_server.wait_for { state == 'VERIFY_RESIZE' }
tests("#confirm_resized_server(#{@confirm_server.id})").succeeds do
@service.confirm_resized_server(@confirm_server.id)
2010-11-29 13:36:10 -05:00
end
@revert_server.wait_for { state == 'VERIFY_RESIZE' }
tests("#revert_resized_server(#{@revert_server.id})").succeeds do
@service.revert_resized_server(@revert_server.id)
2010-11-29 13:36:10 -05:00
end
@confirm_server.wait_for { ready? }
@confirm_server.destroy
2010-11-29 13:36:10 -05:00
@revert_server.wait_for { ready? }
@revert_server.destroy
2010-11-29 13:36:10 -05:00
end