From afbfef93a7a66e8faf9f16481eb4314106b504b0 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Wed, 6 Nov 2019 16:06:43 +0100 Subject: [PATCH] nixos/tests: Ignore shutdown/crash if not booted Condition seems to be inverted. Crash and shutdown only make sense, when the machine is booted; i.e. we return immediately otherwise. In the Perl test driver this is: return unless $self->{booted}; --- nixos/lib/test-driver/test-driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 45b7e229a5c6..c6baf75003a6 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -611,14 +611,14 @@ class Machine: self.log("QEMU running (pid {})".format(self.pid)) def shutdown(self): - if self.booted: + if not self.booted: return self.shell.send("poweroff\n".encode()) self.wait_for_shutdown() def crash(self): - if self.booted: + if not self.booted: return self.log("forced crash")