Merge pull request #72899 from JohnAZoidberg/fix-py-test-driver-crash

nixos/tests: Ignore shutdown/crash if not booted
This commit is contained in:
worldofpeace 2019-11-06 17:28:26 +00:00 committed by GitHub
commit 0923ffb2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -611,14 +611,14 @@ class Machine:
self.log("QEMU running (pid {})".format(self.pid)) self.log("QEMU running (pid {})".format(self.pid))
def shutdown(self): def shutdown(self):
if self.booted: if not self.booted:
return return
self.shell.send("poweroff\n".encode()) self.shell.send("poweroff\n".encode())
self.wait_for_shutdown() self.wait_for_shutdown()
def crash(self): def crash(self):
if self.booted: if not self.booted:
return return
self.log("forced crash") self.log("forced crash")