summary refs log tree commit diff
path: root/nixos/tests/run-in-machine.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/run-in-machine.nix')
-rw-r--r--nixos/tests/run-in-machine.nix19
1 files changed, 11 insertions, 8 deletions
diff --git a/nixos/tests/run-in-machine.nix b/nixos/tests/run-in-machine.nix
index 116f5dc28a6..339a4b9a740 100644
--- a/nixos/tests/run-in-machine.nix
+++ b/nixos/tests/run-in-machine.nix
@@ -10,11 +10,14 @@ let
     drv = pkgs.hello;
     machine = { ... }: { /* services.sshd.enable = true; */ };
   };
-in pkgs.runCommand "verify-output" { inherit output; } ''
-  if [ ! -e "$output/bin/hello" ]; then
-    echo "Derivation built using runInMachine produced incorrect output:" >&2
-    ls -laR "$output" >&2
-    exit 1
-  fi
-  "$output/bin/hello" > "$out"
-''
+
+  test = pkgs.runCommand "verify-output" { inherit output; } ''
+    if [ ! -e "$output/bin/hello" ]; then
+      echo "Derivation built using runInMachine produced incorrect output:" >&2
+      ls -laR "$output" >&2
+      exit 1
+    fi
+    "$output/bin/hello" > "$out"
+  '';
+
+in test // { inherit test; } # To emulate behaviour of makeTest