diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2020-10-02 23:17:40 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2020-10-02 23:28:09 +0200 |
| commit | 0f53c801b91919380a924b402d1ff822bb1dc6ea (patch) | |
| tree | 428a6c2915344177a704d817796ffebdc9366536 /tests | |
| parent | 8e1907a72430aa989125b053573ef0897c480697 (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')
| -rw-r--r-- | tests/guix-environment-container.sh | 4 |
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 |
| 45 | fi | 45 | fi |
| 46 | 46 | ||
| 47 | # Make sure "localhost" resolves. | ||
| 48 | guix 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. |
| 48 | result="`FOOBAR=42; export FOOBAR; guix environment -C --ad-hoc --bootstrap \ | 52 | result="`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\"))'`" |
