From e571b315e22bb5a09e86f8b76a2473b9a65fbcd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Fri, 11 Sep 2020 10:47:03 +0200 Subject: [PATCH] test-driver.py: defaulting keepVmState in Machine init ecb73fd5557d6d438aa7c155e5b1aad89373c6ae introduced a new keepVmState CLI flag for test-driver.py. This CLI flags gets forwarded to the Machine class through create_machine. It created a regression for the boot tests where __main__ end up not being evaluated. See https://github.com/NixOS/nixpkgs/pull/97346#issuecomment-690951837 for bug report. Defaulting keepVmState to false when __main__ ends up not being evaluated. --- nixos/lib/test-driver/test-driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 5d3e632fac2c..156392ad1e32 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -228,7 +228,7 @@ class Machine: return path self.state_dir = os.path.join(tmp_dir, f"vm-state-{self.name}") - if not args["keepVmState"]: + if not args.get("keepVmState", False): self.cleanup_statedir() os.makedirs(self.state_dir, mode=0o700, exist_ok=True) self.shared_dir = create_dir("shared-xchg")