mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
f83b4885e9
- power_off_server - power_on_server - shutdown_server Added required tests
31 lines
698 B
Ruby
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
|