diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-08-06 13:15:54 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-08-07 08:44:08 -0400 |
commit | 7c9225610337c76203540377955ef7ae33302ba0 (patch) | |
tree | 5f32f5c97828a9f5ae023222ad251699a1fe7577 /test | |
parent | a87fb78dd1d7a99b84786364f83f423fdffe892e (diff) | |
download | podman-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')
-rw-r--r-- | test/e2e/pod_infra_container_test.go | 20 |
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)) + }) }) |