diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-02-27 17:30:05 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-10 17:01:08 +0200 |
| commit | 4b81a4df19bc659915e156fed9b12fb9319b11fb (patch) | |
| tree | e2f0f62be9e710dd4885fc7ef41280388a9dbc6a /tests | |
| parent | 2d4f290e17c5dbe4b97ece9320eef0a4ad3d821e (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.sh | 32 |
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. |
| 42 | guix time-machine -C "$channels_file" && echo false | 42 | guix 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. | ||
| 46 | cat > "$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"))))))) | ||
| 73 | EOF | ||
| 74 | guix repl -- "$channels_file" | ||
| 75 | |||
| 44 | if [ -d "$abs_top_srcdir/.git" ] \ | 76 | if [ -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 |
| 46 | then | 78 | then |
