summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-04-23 16:48:30 +0200
committerLudovic Courtès <ludo@gnu.org>2026-05-10 17:01:08 +0200
commitf13901f6cbd663019090963664ace72345165461 (patch)
tree294a2ea6f49725a6ac105bb99604d62d6d3dc0d4 /tests
parent4b81a4df19bc659915e156fed9b12fb9319b11fb (diff)
pull, time-machine: Accept content SWHIDs as arguments to ‘--channels’.
* guix/swh.scm (swhid-content-data): New procedure. (call): Do not close ‘port’ when ‘result’ is the same as ‘port’. * guix/scripts/pull.scm (swhid-content-data*): New procedure. (channel-list): Accept ‘file’ as a SWHID. * tests/guix-time-machine.sh: Add test. * doc/guix.texi (Invoking guix pull): Document it. (Invoking guix time-machine): Likewise. Change-Id: I8145cd8685fe2926b1548d4a2dcd54804d89228a Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-time-machine.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh
index 35b186ad6d1..262e3d5fef8 100644
--- a/tests/guix-time-machine.sh
+++ b/tests/guix-time-machine.sh
@@ -22,7 +22,8 @@
22# 22#
23 23
24channels_file="channels-test-$$.scm" 24channels_file="channels-test-$$.scm"
25trap "rm -f $channels_file" EXIT 25log_file="log-test-$$.log"
26trap "rm -f $channels_file $log_file" EXIT
26 27
27cat > "$channels_file" <<EOF 28cat > "$channels_file" <<EOF
28(system "echo rm -rf /") 29(system "echo rm -rf /")
@@ -73,6 +74,19 @@ cat > "$channels_file" <<EOF
73EOF 74EOF
74guix repl -- "$channels_file" 75guix repl -- "$channels_file"
75 76
77if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
78then
79 # Ignore the user's ~/.config/guix/trusted-channels.scm. Under
80 # ./pre-inst-env zero channels are trusted by default so the following
81 # command must fail.
82 XDG_CONFIG_HOME="$XDG_CACHE_HOME/dot-config" \
83 guix time-machine \
84 -C swh:1:cnt:003e1e0c1b9b358082201332c926ae54e9549002 \
85 2> "$log_file" \
86 && false
87 grep "'guix' is not trusted" "$log_file"
88fi
89
76if [ -d "$abs_top_srcdir/.git" ] \ 90if [ -d "$abs_top_srcdir/.git" ] \
77 || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null 91 || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
78then 92then