tests: make use of vm.shutdown(wait=True)
This commit is contained in:
parent
2c1629da04
commit
cf8b6219a9
@ -1070,12 +1070,9 @@ class SystemTestCase(QubesTestCase):
|
|||||||
subprocess.check_call(command)
|
subprocess.check_call(command)
|
||||||
|
|
||||||
def shutdown_and_wait(self, vm, timeout=60):
|
def shutdown_and_wait(self, vm, timeout=60):
|
||||||
self.loop.run_until_complete(vm.shutdown())
|
try:
|
||||||
while timeout > 0:
|
self.loop.run_until_complete(vm.shutdown(wait=True, timeout=timeout))
|
||||||
if not vm.is_running():
|
except qubes.exc.QubesException:
|
||||||
return
|
|
||||||
self.loop.run_until_complete(asyncio.sleep(1))
|
|
||||||
timeout -= 1
|
|
||||||
name = vm.name
|
name = vm.name
|
||||||
del vm
|
del vm
|
||||||
self.fail("Timeout while waiting for VM {} shutdown".format(name))
|
self.fail("Timeout while waiting for VM {} shutdown".format(name))
|
||||||
|
Loading…
Reference in New Issue
Block a user