summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-22 11:25:27 -0400
committerGitHub <noreply@github.com>2020-10-22 11:25:27 -0400
commitd340f8523c9610644c8a195d1e3e9b3a5d32c5b3 (patch)
tree613012b62e5b3d0308e43ce63a753c1bf69f63c6 /test
parent2cb12bbc5a832e5b69d3b52480377df716dc543b (diff)
parent0864d82cb57097e6632fd2206d4e5b42861ec6e2 (diff)
downloadpodman-d340f8523c9610644c8a195d1e3e9b3a5d32c5b3.tar.gz
podman-d340f8523c9610644c8a195d1e3e9b3a5d32c5b3.tar.bz2
podman-d340f8523c9610644c8a195d1e3e9b3a5d32c5b3.zip
Merge pull request #8101 from mheon/net_none_hostname
Add hostname to /etc/hosts for --net=none
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_networking_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 540ac5409..76d5c4cdc 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -584,6 +584,14 @@ var _ = Describe("Podman run networking", func() {
run := podmanTest.Podman([]string{"run", "--net=host", "--hostname", hostname, ALPINE, "hostname"})
run.WaitWithDefaultTimeout()
Expect(run.ExitCode()).To(BeZero())
- Expect(strings.Contains(run.OutputToString(), "testctr")).To(BeTrue())
+ Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue())
+ })
+
+ It("podman run with --net=none adds hostname to /etc/hosts", func() {
+ hostname := "testctr"
+ run := podmanTest.Podman([]string{"run", "--net=none", "--hostname", hostname, ALPINE, "hostname"})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(BeZero())
+ Expect(strings.Contains(run.OutputToString(), hostname)).To(BeTrue())
})
})