diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-10-06 07:04:18 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-10-07 08:39:44 -0400 |
commit | 3ae47f7d2b9328ff47dc5702d834ae9ee296a27b (patch) | |
tree | 3818c5febd0457d5cec8cc5f09b8b34179239c7e /test | |
parent | a7500e54a4646c7db477349e2530ac13df77b8fa (diff) | |
download | podman-3ae47f7d2b9328ff47dc5702d834ae9ee296a27b.tar.gz podman-3ae47f7d2b9328ff47dc5702d834ae9ee296a27b.tar.bz2 podman-3ae47f7d2b9328ff47dc5702d834ae9ee296a27b.zip |
Populate /etc/hosts file when run in a user namespace
We do not populate the hostname field with the IP Address
when running within a user namespace.
Fixes https://github.com/containers/podman/issues/7490
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_networking_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 044e56e6c..0f8b3e939 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -477,6 +477,17 @@ var _ = Describe("Podman run networking", func() { Expect(session.ExitCode()).To(Equal(0)) }) + It("podman run --uidmap /etc/hosts contains --hostname", func() { + SkipIfRootless("uidmap population of cninetworks not supported for rootless users") + session := podmanTest.Podman([]string{"run", "--uidmap", "0:100000:1000", "--rm", "--hostname", "foohostname", ALPINE, "grep", "foohostname", "/etc/hosts"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"run", "--uidmap", "0:100000:1000", "--rm", "--hostname", "foohostname", "-v", "/etc/hosts:/etc/hosts", ALPINE, "grep", "foohostname", "/etc/hosts"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(1)) + }) + It("podman run network in user created network namespace", func() { SkipIfRootless("ip netns is not supported for rootless users") if Containerized() { |