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:
parent
a4c7cc460a
commit
a7372e0351
1 changed files with 3 additions and 10 deletions
|
@ -8,24 +8,17 @@ Shindo.tests('Fog::Compute[:digitalocean] | power on/off/shutdown requests',
|
||||||
|
|
||||||
test('#power_off_server') do
|
test('#power_off_server') do
|
||||||
server.wait_for(120) { ready? }
|
server.wait_for(120) { ready? }
|
||||||
service.power_off_server(server.id)
|
service.power_off_server(server.id).body['status'] == 'OK'
|
||||||
server.wait_for(120) { !ready? }
|
|
||||||
server.status == 'off'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test('#power_on_server') do
|
test('#power_on_server') do
|
||||||
service.power_on_server server.id
|
service.power_on_server(server.id).body['status'] == 'OK'
|
||||||
server.wait_for(120) { ready? }
|
|
||||||
server.ready?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test('#shutdown_server') do
|
test('#shutdown_server') do
|
||||||
service.shutdown_server server.id
|
service.shutdown_server(server.id).body['status'] == 'OK'
|
||||||
server.wait_for(120) { !ready? }
|
|
||||||
server.status == 'off'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# restore status
|
|
||||||
server.start
|
server.start
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue