2012-03-02 12:38:22 +00:00
|
|
|
{ system ? builtins.currentSystem
|
2018-11-11 08:41:11 +00:00
|
|
|
, config ? {}
|
2010-10-21 22:50:12 +00:00
|
|
|
, networkExpr
|
|
|
|
}:
|
|
|
|
|
2020-04-13 15:43:44 +00:00
|
|
|
let
|
|
|
|
nodes = builtins.mapAttrs (vm: module: {
|
|
|
|
_file = "${networkExpr}@node-${vm}";
|
2020-10-24 22:59:59 +00:00
|
|
|
imports = [ module ];
|
2020-04-13 15:43:44 +00:00
|
|
|
}) (import networkExpr);
|
2021-06-12 22:47:25 +00:00
|
|
|
|
2021-08-20 09:48:15 +00:00
|
|
|
pkgs = import ../../../../.. { inherit system config; };
|
|
|
|
|
2021-06-12 22:47:25 +00:00
|
|
|
testing = import ../../../../lib/testing-python.nix {
|
2021-08-20 09:48:15 +00:00
|
|
|
inherit system pkgs;
|
2021-06-12 22:47:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
interactiveDriver = (testing.makeTest { inherit nodes; testScript = "start_all(); join_all();"; }).driverInteractive;
|
2020-04-13 15:43:44 +00:00
|
|
|
in
|
2011-04-27 13:01:42 +00:00
|
|
|
|
2011-01-16 21:57:09 +00:00
|
|
|
|
2021-08-20 09:48:15 +00:00
|
|
|
pkgs.runCommand "nixos-build-vms" { nativeBuildInputs = [ pkgs.makeWrapper ]; } ''
|
2021-06-12 22:47:25 +00:00
|
|
|
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"
|
2022-02-19 18:35:40 +00:00
|
|
|
wrapProgram $out/bin/nixos-run-vms \
|
|
|
|
--set testScript "${pkgs.writeText "start-all" "start_all(); join_all();"}" \
|
|
|
|
--add-flags "--no-interactive"
|
2021-06-12 22:47:25 +00:00
|
|
|
''
|