summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-02-27 17:30:05 +0100
committerLudovic Courtès <ludo@gnu.org>2026-05-10 17:01:08 +0200
commit4b81a4df19bc659915e156fed9b12fb9319b11fb (patch)
treee2f0f62be9e710dd4885fc7ef41280388a9dbc6a /tests
parent2d4f290e17c5dbe4b97ece9320eef0a4ad3d821e (diff)
pull, time-machine: Support transparent download of channel files.
* guix/scripts/pull.scm (%default-options): Add ‘require-trusted-channels?’. (show-help, %options): Add ‘--allow-untrusted-channels’. (trusted-channels, equivalent-channels?, check-trusted-channels): New procedures. (channel-list)[require-trusted-channels?]: New variable. [load-channels]: Honor it and call ‘check-trusted-channels’. * guix/scripts/time-machine.scm (show-help, %options): Add ‘--allow-untrusted-channels’. (%default-options): Add ‘require-trusted-channels?’. * tests/guix-time-machine.sh: Add test. * doc/guix.texi (Invoking guix pull): Update ‘--channels’ documentation and document ‘allow-untrusted-channels’. (Invoking guix time-machine): Likewise. (Channels with Substitutes): Add example of ‘guix pull’ with a URL. Change-Id: If0bb6acaedf324e35a21c9c7d285f3e423ae49aa Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-time-machine.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh
index 30daf13ef1e..35b186ad6d1 100644
--- a/tests/guix-time-machine.sh
+++ b/tests/guix-time-machine.sh
@@ -41,6 +41,38 @@ EOF
41# Likewise, 'use-modules' is not available. 41# Likewise, 'use-modules' is not available.
42guix time-machine -C "$channels_file" && echo false 42guix time-machine -C "$channels_file" && echo false
43 43
44# Get 'time-machine' to download a channel file with an untrusted channel.
45# Check that this fails with a "'guix' is not trusted" message.
46cat > "$channels_file" <<EOF
47(use-modules (guix tests http)
48 (guix diagnostics)
49 (guix scripts time-machine))
50
51(define channels
52 '(list (channel
53 (name 'guix)
54 (url "https://example.org/evil/guix.git")
55 (branch "devel")
56 (commit "cabba9e900d2350aef42e65643de78500b2aad06")
57 (introduction
58 (make-channel-introduction
59 "badcafef1d5c170db68aa4bbfb77024fdc468ed3"
60 (openpgp-fingerprint
61 "CABB A9EE 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5"))))))
62
63(with-http-server (list (list 200 (object->string channels)))
64 (let ((error (open-output-string)))
65 (catch 'quit
66 (lambda ()
67 (parameterize ((guix-warning-port error))
68 (guix-time-machine "-C" (%local-url) "--" "describe")
69 (primitive-exit 1)))
70 (lambda _
71 (exit (->bool (string-contains (get-output-string error)
72 "'guix' is not trusted")))))))
73EOF
74guix repl -- "$channels_file"
75
44if [ -d "$abs_top_srcdir/.git" ] \ 76if [ -d "$abs_top_srcdir/.git" ] \
45 || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null 77 || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
46then 78then