summaryrefslogtreecommitdiff
path: root/test/system/030-run.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/system/030-run.bats')
-rw-r--r--test/system/030-run.bats10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 6f1fa600a..55514305b 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -756,4 +756,14 @@ EOF
is "$output" ".*TERM=abc" "missing TERM environment variable despite TERM being set on commandline"
}
+@test "podman run - no /etc/hosts" {
+ skip_if_rootless "cannot move /etc/hosts file as a rootless user"
+ tmpfile=$PODMAN_TMPDIR/hosts
+ mv /etc/hosts $tmpfile
+ run_podman '?' run --rm --add-host "foo.com:1.2.3.4" $IMAGE cat "/etc/hosts"
+ mv $tmpfile /etc/hosts
+ is "$status" 0 "podman run without /etc/hosts file should work"
+ is "$output" "1.2.3.4 foo.com.*" "users can add hosts even without /etc/hosts"
+}
+
# vim: filetype=sh