diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-16 17:15:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 17:15:08 -0400 |
commit | 0acf540304b7d2f57357522e4fb47914b0b31a70 (patch) | |
tree | bfd2527bf2ebfd9ff18baa002b3cc6ce938b7edc /test | |
parent | a65000bbb79d616cbd2172c4d86b9c8521b1cfab (diff) | |
parent | f1ee234252768921313ddbbdbb7184585800bdbb (diff) | |
download | podman-0acf540304b7d2f57357522e4fb47914b0b31a70.tar.gz podman-0acf540304b7d2f57357522e4fb47914b0b31a70.tar.bz2 podman-0acf540304b7d2f57357522e4fb47914b0b31a70.zip |
Merge pull request #11605 from Luap99/hosts
Only add 127.0.0.1 entry to /etc/hosts with --net=none
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_networking_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 8eabeba97..c7ffdaf4c 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -709,6 +709,18 @@ var _ = Describe("Podman run networking", func() { Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue()) }) + It("podman run with pod does not add extra 127 entry to /etc/hosts", func() { + pod := "testpod" + hostname := "test-hostname" + run := podmanTest.Podman([]string{"pod", "create", "--hostname", hostname, "--name", pod}) + run.WaitWithDefaultTimeout() + Expect(run).Should(Exit(0)) + run = podmanTest.Podman([]string{"run", "--pod", pod, ALPINE, "cat", "/etc/hosts"}) + run.WaitWithDefaultTimeout() + Expect(run).Should(Exit(0)) + Expect(run.OutputToString()).ToNot(ContainSubstring("127.0.0.1 %s", hostname)) + }) + ping_test := func(netns string) { hostname := "testctr" run := podmanTest.Podman([]string{"run", netns, "--hostname", hostname, ALPINE, "ping", "-c", "1", hostname}) |