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/models/compute_v2/server_tests.rb
Brad Gignac 4d82f7bbc4 [rackspace|compute] Set password attribute on V2 servers.
Provides a method for determining next-gen server passwords.
Adds a read-only attribute to next-gen servers for storing
the root password. The attribute is set whenever a new server
is created or the password on an existing server is changed.
2012-08-08 21:57:37 -04:00

62 lines
1.7 KiB
Ruby

Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
pending if Fog.mocking?
service = Fog::Compute::RackspaceV2.new
options = {
:name => "fog_server_#{Time.now.to_i.to_s}",
:flavor_id => 2,
:image_id => '3afe97b2-26dc-49c5-a2cc-a2fc8d80c001'
}
model_tests(service.servers, options, false) do
@instance.wait_for { ready? }
tests('#reboot("SOFT")').succeeds do
@instance.reboot('SOFT')
returns('REBOOT') { @instance.state }
end
@instance.wait_for { ready? }
tests('#reboot("HARD")').succeeds do
@instance.reboot('HARD')
returns('HARD_REBOOT') { @instance.state }
end
@instance.wait_for { ready? }
tests('#rebuild').succeeds do
@instance.rebuild('5cebb13a-f783-4f8c-8058-c4182c724ccd')
returns('REBUILD') { @instance.state }
end
@instance.wait_for { ready? }
tests('#resize').succeeds do
@instance.resize(3)
returns('RESIZE') { @instance.state }
end
@instance.wait_for { state == 'VERIFY_RESIZE' }
tests('#confirm_resize').succeeds do
@instance.confirm_resize
end
@instance.wait_for { ready? }
tests('#resize').succeeds do
@instance.resize(2)
returns('RESIZE') { @instance.state }
end
@instance.wait_for { state == 'VERIFY_RESIZE' }
tests('#revert_resize').succeeds do
@instance.revert_resize
end
@instance.wait_for { ready? }
tests('#change_admin_password').succeeds do
@instance.change_admin_password('somerandompassword')
returns('PASSWORD') { @instance.state }
returns('somerandompassword') { @instance.password }
end
@instance.wait_for { ready? }
end
end