1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/digitalocean/requests/compute/power_state_tests.rb
Sergio Rubio f83b4885e9 [digitalocean|compute] Implement missing requests
- power_off_server
- power_on_server
- shutdown_server

Added required tests
2013-03-31 22:16:09 +02:00

31 lines
698 B
Ruby

Shindo.tests('Fog::Compute[:digitalocean] | reboot_server request', ['digitalocean', 'compute']) do
service = Fog::Compute[:digitalocean]
server = fog_test_server
tests('success') do
test('#power_off_server') do
service.power_off_server(server.id)
server.wait_for(120) { !ready? }
server.status == 'off'
end
test('#power_on_server') do
service.power_on_server server.id
server.wait_for(120) { ready? }
server.ready?
end
test('#shutdown_server') do
service.shutdown_server server.id
server.wait_for(120) { status == 'off' }
server.status == 'off'
end
# restore status
server.start
end
end