1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[digitalocean|compute] improve power state tests reliability

power on/off actions are asyncronous and somewhat unreliable so waiting
for server state changes to validate tests does not help. Check only if
API returns OK when requesting and trust DigitalOcean is doing its
thing.
This commit is contained in:
Sergio Rubio 2013-03-18 15:06:01 +01:00
parent a4c7cc460a
commit a7372e0351

View file

@ -8,24 +8,17 @@ Shindo.tests('Fog::Compute[:digitalocean] | power on/off/shutdown requests',
test('#power_off_server') do
server.wait_for(120) { ready? }
service.power_off_server(server.id)
server.wait_for(120) { !ready? }
server.status == 'off'
service.power_off_server(server.id).body['status'] == 'OK'
end
test('#power_on_server') do
service.power_on_server server.id
server.wait_for(120) { ready? }
server.ready?
service.power_on_server(server.id).body['status'] == 'OK'
end
test('#shutdown_server') do
service.shutdown_server server.id
server.wait_for(120) { !ready? }
server.status == 'off'
service.shutdown_server(server.id).body['status'] == 'OK'
end
# restore status
server.start
end