summary refs log tree commit diff
path: root/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
diff options
context:
space:
mode:
authorDavid Arnold <dar@xoe.solutions>2021-06-12 17:47:25 -0500
committerDavid Arnold <david.arnold@iohk.io>2021-10-05 14:38:48 -0500
commitb0fc9da879812e47c1ed3438fb0fd51db00a3494 (patch)
treec238d3e8ce9c6ad17c47e8414001a29e137d8e52 /nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
parent3069ba0dd1dec75c5dc4f6a1ee238a4fab9828cd (diff)
downloadnixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.tar
nixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.tar.gz
nixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.tar.bz2
nixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.tar.lz
nixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.tar.xz
nixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.tar.zst
nixpkgs-b0fc9da879812e47c1ed3438fb0fd51db00a3494.zip
nixos/test/test-driver: Class-ify the test driver
This commit encapsulates the involved domain into classes and
defines explicit and typed arguments where untyped dicts where used.

It preserves backwards compatibility through legacy wrappers.
Diffstat (limited to 'nixos/modules/installer/tools/nixos-build-vms/build-vms.nix')
-rw-r--r--nixos/modules/installer/tools/nixos-build-vms/build-vms.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix b/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
index e49ceba2424..ce69b16cffa 100644
--- a/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
+++ b/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
@@ -8,11 +8,20 @@ let
     _file = "${networkExpr}@node-${vm}";
     imports = [ module ];
   }) (import networkExpr);
+
+  testing = import ../../../../lib/testing-python.nix {
+    inherit system;
+    pkgs = import ../../../../.. { inherit system config; };
+  };
+
+  interactiveDriver = (testing.makeTest { inherit nodes; testScript = "start_all(); join_all();"; }).driverInteractive;
 in
 
-with import ../../../../lib/testing-python.nix {
-  inherit system;
-  pkgs = import ../../../../.. { inherit system config; };
-};
 
-(makeTest { inherit nodes; testScript = ""; }).driverInteractive
+pkgs.runCommand "nixos-build-vms" ''
+  mkdir -p $out/bin
+  ln -s ${interactiveDriver}/bin/nixos-test-driver $out/bin/nixos-test-driver
+  ln -s ${interactiveDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
+  wrapProgram $out/bin/nixos-test-driver \
+    --add-flags "--interactive"
+''