summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-02-26 20:55:36 +0100
committerLudovic Courtès <ludo@gnu.org>2026-05-10 17:01:07 +0200
commit36d431c05153ac0c82c443ac5d17466958544ada (patch)
tree83ad8a22f67aaaf3ea5de91c0191a7558001b277 /tests
parent568f8e97a76dc4bf14f01e4d2a080bd27fb9c927 (diff)
pull, time-machine: Evaluate channels in a sandbox by default.
* guix/scripts/pull.scm (%default-options): Add ‘isolated-channel-evaluation?’. (show-help, %options): Add ‘--unsafe-channel-evaluation’. (%safe-channel-bindings): New variable. (channel-list): Honor ‘isolated-channel-evaluation?’. * guix/scripts/time-machine.scm (show-help, %options): Add ‘--unsafe-channel-evaluation’. (%default-options): Add ‘isolated-channel-evaluation?’. * tests/guix-time-machine.sh: Test use of unauthorized bindings in channel files. * doc/guix.texi (Invoking guix time-machine): Document ‘--unsafe-channel-evaluation’. (Invoking guix pull): Likewise. (Channels with Substitutes): Add index entry for ‘channel-with-substitutes-available’. Mention that it requires ‘--unsafe-channel-evaluation’. Change-Id: I75f60dba516f42ef62a9d779cde8e2f0a9d0c140 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-time-machine.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh
index 608d4d560bf..30daf13ef1e 100644
--- a/tests/guix-time-machine.sh
+++ b/tests/guix-time-machine.sh
@@ -1,6 +1,6 @@
1# GNU Guix --- Functional package management for GNU 1# GNU Guix --- Functional package management for GNU
2# Copyright © 2023 Maxim Cournoyer <maxim@guixotic.coop> 2# Copyright © 2023 Maxim Cournoyer <maxim@guixotic.coop>
3# Copyright © 2023-2024 Ludovic Courtès <ludo@gnu.org> 3# Copyright © 2023-2024, 2026 Ludovic Courtès <ludo@gnu.org>
4# 4#
5# This file is part of GNU Guix. 5# This file is part of GNU Guix.
6# 6#
@@ -21,6 +21,26 @@
21# Test the 'guix time-machine' command-line utility. 21# Test the 'guix time-machine' command-line utility.
22# 22#
23 23
24channels_file="channels-test-$$.scm"
25trap "rm -f $channels_file" EXIT
26
27cat > "$channels_file" <<EOF
28(system "echo rm -rf /")
29%default-channels
30EOF
31
32# This must fail: 'system' is not among the available bindings in the
33# evaluation sandbox.
34guix time-machine -C "$channels_file" && echo false
35
36cat > "$channels_file" <<EOF
37(use-modules (system foreign))
38%default-channels
39EOF
40
41# Likewise, 'use-modules' is not available.
42guix time-machine -C "$channels_file" && echo false
43
24if [ -d "$abs_top_srcdir/.git" ] \ 44if [ -d "$abs_top_srcdir/.git" ] \
25 || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null 45 || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
26then 46then