diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 3c6f89dcb2ae..0324587339f6 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1035,7 +1035,10 @@ in nix-config = runTest ./nix-config.nix; nix-ld = runTest ./nix-ld.nix; nix-misc = handleTest ./nix/misc.nix { }; - nix-upgrade = handleTest ./nix/upgrade.nix { inherit (pkgs) nixVersions; }; + nix-upgrade = handleTest ./nix/upgrade.nix { + inherit (pkgs) nixVersions; + inherit system; + }; nix-required-mounts = runTest ./nix-required-mounts; nix-serve = runTest ./nix-serve.nix; nix-serve-ssh = runTest ./nix-serve-ssh.nix; diff --git a/nixos/tests/nix/upgrade.nix b/nixos/tests/nix/upgrade.nix index e4cd0cb09b8f..a014313aa53a 100644 --- a/nixos/tests/nix/upgrade.nix +++ b/nixos/tests/nix/upgrade.nix @@ -1,10 +1,15 @@ -{ pkgs, nixVersions, ... }: +{ + pkgs, + nixVersions, + system, + ... +}: let lib = pkgs.lib; fallback-paths-external = pkgs.writeTextDir "fallback-paths.nix" '' { - ${pkgs.system} = "${nixVersions.latest}"; + ${system} = "${nixVersions.latest}"; }''; nixos-module = builtins.toFile "nixos-module.nix" '' @@ -71,7 +76,7 @@ pkgs.testers.nixosTest { if not match: raise Exception("Couldn't find new version in output: " + result) with subtest("nix-build-with-mismatch-daemon"): - machine.succeed("runuser -u alice -- nix build --expr 'derivation {name =\"test\"; system = \"${pkgs.system}\";builder = \"/bin/sh\"; args = [\"-c\" \"echo test > $out\"];}' --print-out-paths") + machine.succeed("runuser -u alice -- nix build --expr 'derivation {name =\"test\"; system = \"${system}\";builder = \"/bin/sh\"; args = [\"-c\" \"echo test > $out\"];}' --print-out-paths") with subtest("remove-new-nix"): @@ -94,7 +99,7 @@ pkgs.testers.nixosTest { if not match: raise Exception("Couldn't find new version in output: " + result) with subtest("nix-build-with-new-daemon"): - machine.succeed("runuser -u alice -- nix build --expr 'derivation {name =\"test-new\"; system = \"${pkgs.system}\";builder = \"/bin/sh\"; args = [\"-c\" \"echo test > $out\"];}' --print-out-paths") + machine.succeed("runuser -u alice -- nix build --expr 'derivation {name =\"test-new\"; system = \"${system}\";builder = \"/bin/sh\"; args = [\"-c\" \"echo test > $out\"];}' --print-out-paths") with subtest("nix-collect-garbage-with-old-nix"): machine.succeed("${nixVersions.stable}/bin/nix-collect-garbage")