summaryrefslogtreecommitdiff
path: root/tests/guix-environment-container.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-10-04 22:40:26 +0200
committerLudovic Courtès <ludo@gnu.org>2020-10-05 10:41:59 +0200
commitb68d4106518abed20ba308831b65dcc69bf120a5 (patch)
treeb20b8d4542ec2363cb47c9deb86788e440f1757c /tests/guix-environment-container.sh
parent5aa7d764be7018ef3e5bef34857970c103c6abaf (diff)
environment: Turn "lo" up in network-less containers.
This is a followup to 0f53c801b91919380a924b402d1ff822bb1dc6ea. * guix/scripts/environment.scm (launch-environment/container): Add call to 'set-network-interface-up'. * tests/guix-environment-container.sh: Add test.
Diffstat (limited to 'tests/guix-environment-container.sh')
-rw-r--r--tests/guix-environment-container.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index 3674aa60269..f2d15c8d0c7 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -48,6 +48,17 @@ fi
48guix environment --container --ad-hoc --bootstrap guile-bootstrap \ 48guix environment --container --ad-hoc --bootstrap guile-bootstrap \
49 -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))' 49 -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))'
50 50
51# We should get ECONNREFUSED, not ENETUNREACH, which would indicate that "lo"
52# is down.
53guix environment --container --ad-hoc --bootstrap guile-bootstrap \
54 -- guile -c "(exit (= ECONNREFUSED
55 (catch 'system-error
56 (lambda ()
57 (let ((sock (socket AF_INET SOCK_STREAM 0)))
58 (connect sock AF_INET INADDR_LOOPBACK 12345)))
59 (lambda args
60 (pk 'errno (system-error-errno args))))))"
61
51# Make sure '--preserve' is honored. 62# Make sure '--preserve' is honored.
52result="`FOOBAR=42; export FOOBAR; guix environment -C --ad-hoc --bootstrap \ 63result="`FOOBAR=42; export FOOBAR; guix environment -C --ad-hoc --bootstrap \
53 guile-bootstrap -E ^FOO -- guile -c '(display (getenv \"FOOBAR\"))'`" 64 guile-bootstrap -E ^FOO -- guile -c '(display (getenv \"FOOBAR\"))'`"