diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-03-27 09:37:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 09:37:53 -0400 |
commit | 1d539aa28711b4214867ebd8db85de1000bbbe59 (patch) | |
tree | 929f51b4ac854efe96ab8ec59b98ea7c64532741 /tests | |
parent | 5a0f5b5c34d90fe6515d23446402c491b992a99b (diff) | |
parent | 128994509f3d514b6a14f42f7459a40fe2d38bd4 (diff) |
Merge pull request #8073 from tweag/fix-root-channels-location
Fix root channels location
Diffstat (limited to 'tests')
-rw-r--r-- | tests/installer/default.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/installer/default.nix b/tests/installer/default.nix index 31d83699d..8c9784eaf 100644 --- a/tests/installer/default.nix +++ b/tests/installer/default.nix @@ -30,6 +30,14 @@ let }; }; + mockChannel = pkgs: + pkgs.runCommandNoCC "mock-channel" {} '' + mkdir nixexprs + mkdir $out + echo -n 'someContent' > nixexprs/someFile + tar cvf - nixexprs | bzip2 > $out/nixexprs.tar.bz2 + ''; + disableSELinux = "sudo setenforce 0"; images = { @@ -189,6 +197,9 @@ let echo "Running installer..." $ssh "set -eux; $installScript" + echo "Copying the mock channel" + scp -r -P 20022 $ssh_opts ${mockChannel pkgs} vagrant@localhost:channel + echo "Testing Nix installation..." $ssh <<EOF set -ex @@ -204,6 +215,17 @@ let out=\$(nix-build --no-substitute -E 'derivation { name = "foo"; system = "x86_64-linux"; builder = "/bin/sh"; args = ["-c" "echo foobar > \$out"]; }') [[ \$(cat \$out) = foobar ]] + + if pgrep nix-daemon; then + MAYBESUDO="sudo" + else + MAYBESUDO="" + fi + + + $MAYBESUDO \$(which nix-channel) --add file://\$HOME/channel myChannel + $MAYBESUDO \$(which nix-channel) --update + [[ \$(nix-instantiate --eval --expr 'builtins.readFile <myChannel/someFile>') = '"someContent"' ]] EOF echo "Done!" |