summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@mit.edu>2021-10-26 14:09:05 -0700
committerAnders Kaseorg <andersk@mit.edu>2021-10-26 16:45:36 -0700
commit97e39fcafa593264f4aba8338b69a9293f772e15 (patch)
tree0672f1070d55e9078fe321f67abc3d4de37e5d99
parentc7c01d3c63c2f2a5bc97e412c73d9949b73cb80c (diff)
downloadnixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.tar
nixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.tar.gz
nixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.tar.bz2
nixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.tar.lz
nixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.tar.xz
nixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.tar.zst
nixpkgs-97e39fcafa593264f4aba8338b69a9293f772e15.zip
nixosTests.hibernate: Make sure machines are shut down when finished
Co-authored-by: Janne Heß <janne@hess.ooo>
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
-rw-r--r--nixos/tests/hibernate.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix
index ae506c8542f..f0d5da4a95e 100644
--- a/nixos/tests/hibernate.nix
+++ b/nixos/tests/hibernate.nix
@@ -68,7 +68,7 @@ in makeTest {
   testScript =
     ''
       def create_named_machine(name):
-          return create_machine(
+          machine = create_machine(
               {
                   "qemuFlags": "-cpu max ${
                     if system == "x86_64-linux" then "-m 1024"
@@ -78,6 +78,8 @@ in makeTest {
                   "name": name,
               }
           )
+          driver.machines.append(machine)
+          return machine
 
 
       # Install NixOS