From 0f53c801b91919380a924b402d1ff822bb1dc6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 2 Oct 2020 23:17:40 +0200 Subject: environment: Provide /etc/hosts in containers without '--network'. Fixes . * guix/scripts/environment.scm (launch-environment/container): Create /etc/hosts when NETWORK? is false. * tests/guix-environment-container.sh: Add "localhost" resolution test. --- tests/guix-environment-container.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/guix-environment-container.sh') diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index 040f32cce9..3674aa6026 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -44,6 +44,10 @@ else test $? = 42 fi +# Make sure "localhost" resolves. +guix environment --container --ad-hoc --bootstrap guile-bootstrap \ + -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))' + # Make sure '--preserve' is honored. result="`FOOBAR=42; export FOOBAR; guix environment -C --ad-hoc --bootstrap \ guile-bootstrap -E ^FOO -- guile -c '(display (getenv \"FOOBAR\"))'`" -- cgit v1.2.3