nixosTests.nix-upgrade: fix eval

Changed files
+13 -5
nixos
+4 -1
nixos/tests/all-tests.nix
···
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;
+9 -4
nixos/tests/nix/upgrade.nix
···
-
{ 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" ''
···
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"):
···
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")