summaryrefslogtreecommitdiff
path: root/tests/guix-environment-container.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-10-02 23:17:40 +0200
committerLudovic Courtès <ludo@gnu.org>2020-10-02 23:28:09 +0200
commit0f53c801b91919380a924b402d1ff822bb1dc6ea (patch)
tree428a6c2915344177a704d817796ffebdc9366536 /tests/guix-environment-container.sh
parent8e1907a72430aa989125b053573ef0897c480697 (diff)
environment: Provide /etc/hosts in containers without '--network'.
Fixes <https://bugs.gnu.org/43762>. * guix/scripts/environment.scm (launch-environment/container): Create /etc/hosts when NETWORK? is false. * tests/guix-environment-container.sh: Add "localhost" resolution test.
Diffstat (limited to 'tests/guix-environment-container.sh')
-rw-r--r--tests/guix-environment-container.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index 040f32cce92..3674aa60269 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -44,6 +44,10 @@ else
44 test $? = 42 44 test $? = 42
45fi 45fi
46 46
47# Make sure "localhost" resolves.
48guix environment --container --ad-hoc --bootstrap guile-bootstrap \
49 -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))'
50
47# Make sure '--preserve' is honored. 51# Make sure '--preserve' is honored.
48result="`FOOBAR=42; export FOOBAR; guix environment -C --ad-hoc --bootstrap \ 52result="`FOOBAR=42; export FOOBAR; guix environment -C --ad-hoc --bootstrap \
49 guile-bootstrap -E ^FOO -- guile -c '(display (getenv \"FOOBAR\"))'`" 53 guile-bootstrap -E ^FOO -- guile -c '(display (getenv \"FOOBAR\"))'`"