summaryrefslogtreecommitdiff
path: root/test/e2e/pod_infra_container_test.go
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2019-08-06 13:15:54 -0400
committerPeter Hunt <pehunt@redhat.com>2019-08-07 08:44:08 -0400
commit7c9225610337c76203540377955ef7ae33302ba0 (patch)
tree5f32f5c97828a9f5ae023222ad251699a1fe7577 /test/e2e/pod_infra_container_test.go
parenta87fb78dd1d7a99b84786364f83f423fdffe892e (diff)
downloadpodman-7c9225610337c76203540377955ef7ae33302ba0.tar.gz
podman-7c9225610337c76203540377955ef7ae33302ba0.tar.bz2
podman-7c9225610337c76203540377955ef7ae33302ba0.zip
add test to verify hostname is shared in a pod
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'test/e2e/pod_infra_container_test.go')
-rw-r--r--test/e2e/pod_infra_container_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index c8763de9f..3897aa851 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -383,4 +383,24 @@ var _ = Describe("Podman pod create", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
+
+ It("podman run hostname is shared", func() {
+ session := podmanTest.Podman([]string{"pod", "create"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ podID := session.OutputToString()
+
+ // verify we can add a host to the infra's /etc/hosts
+ session = podmanTest.Podman([]string{"run", "--pod", podID, ALPINE, "hostname"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ hostname := session.OutputToString()
+
+ infraName := podID[:12] + "-infra"
+ // verify we can see the other hosts of infra's /etc/hosts
+ session = podmanTest.Podman([]string{"inspect", infraName})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring(hostname))
+ })
})