diff options
| author | Reepca Russelstein <reepca@russelstein.xyz> | 2026-06-28 23:03:28 -0500 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-06-30 10:57:49 +0200 |
| commit | e3062240efe5f7348399759ceb14309936946757 (patch) | |
| tree | d5949b7567069f881b96c3f9d4b6ee6983f8c8cb /tests | |
| parent | bb6f47ea7765d1e5b908f1129a30208c60851a69 (diff) | |
tests: guix-time-machine: explicitly configure zero trusted channels.
(current-channels) is empty in a regular guix checkout, but 'guix build guix'
passes --with-channel-commit=..., which causes it to return the configured
guix channel. Consequently (trusted-channels) isn't empty and these tests
fail in 'guix build guix'.
* tests/guix-time-machine.sh: explicitly create an empty trusted-channels.scm.
Change-Id: I4584ee96f49edbad414cae611126679e9000e555
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/guix-time-machine.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh index e61232f94fa..6a273fd3935 100644 --- a/tests/guix-time-machine.sh +++ b/tests/guix-time-machine.sh | |||
| @@ -74,11 +74,16 @@ cat > "$channels_file" <<EOF | |||
| 74 | EOF | 74 | EOF |
| 75 | guix repl -- "$channels_file" | 75 | guix repl -- "$channels_file" |
| 76 | 76 | ||
| 77 | # Under 'pre-inst-env', there are zero trusted channels by default. | ||
| 78 | cat > "$channels_file" <<EOF | 77 | cat > "$channels_file" <<EOF |
| 79 | %default-channels | 78 | %default-channels |
| 80 | EOF | 79 | EOF |
| 81 | 80 | ||
| 81 | # Ensure there are zero trusted channels | ||
| 82 | mkdir -p "$XDG_CACHE_HOME/dot-config/guix" | ||
| 83 | cat > "$XDG_CACHE_HOME/dot-config/guix/trusted-channels.scm" <<EOF | ||
| 84 | (list) | ||
| 85 | EOF | ||
| 86 | |||
| 82 | # Ignore the user's ~/.config/guix/trusted-channels.scm and ensure this | 87 | # Ignore the user's ~/.config/guix/trusted-channels.scm and ensure this |
| 83 | # command fails. | 88 | # command fails. |
| 84 | XDG_CONFIG_HOME="$XDG_CACHE_HOME/dot-config" \ | 89 | XDG_CONFIG_HOME="$XDG_CACHE_HOME/dot-config" \ |
| @@ -87,9 +92,8 @@ grep "'guix' is not trusted" "$log_file" | |||
| 87 | 92 | ||
| 88 | if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null | 93 | if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null |
| 89 | then | 94 | then |
| 90 | # Ignore the user's ~/.config/guix/trusted-channels.scm. Under | 95 | # Ignore the user's ~/.config/guix/trusted-channels.scm. We've ensured |
| 91 | # ./pre-inst-env zero channels are trusted by default so the following | 96 | # there are no trusted channels so the following command must fail. |
| 92 | # command must fail. | ||
| 93 | XDG_CONFIG_HOME="$XDG_CACHE_HOME/dot-config" \ | 97 | XDG_CONFIG_HOME="$XDG_CACHE_HOME/dot-config" \ |
| 94 | guix time-machine \ | 98 | guix time-machine \ |
| 95 | -C swh:1:cnt:003e1e0c1b9b358082201332c926ae54e9549002 \ | 99 | -C swh:1:cnt:003e1e0c1b9b358082201332c926ae54e9549002 \ |
