aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-06-24 15:55:09 -0400
committerMatthew Heon <mheon@redhat.com>2020-06-25 15:35:58 -0400
commitdc22350be5f59f612342bc53ec9689f0b2c2145a (patch)
tree3f6534a068d2ec65feb248c9d16fe6c9000ba640 /test
parent48ce67fb5630e67f17f2460b30a0f9cddc21ab8f (diff)
downloadpodman-dc22350be5f59f612342bc53ec9689f0b2c2145a.tar.gz
podman-dc22350be5f59f612342bc53ec9689f0b2c2145a.tar.bz2
podman-dc22350be5f59f612342bc53ec9689f0b2c2145a.zip
Print port mappings in `ps` for ctrs sharing network
In Podman v1.9, we printed port mappings for the container, even if it shared its network namespace (and thus ports) with another container. We regressed on this in Podman v2.0, which is fixed here. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/ps_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index 0dc8e01af..cfc0a415e 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -449,4 +449,21 @@ var _ = Describe("Podman ps", func() {
Expect(len(output)).To(Equal(1))
Expect(output[0]).To(Equal(ctrName))
})
+
+ It("podman ps test with port shared with pod", func() {
+ podName := "testPod"
+ pod := podmanTest.Podman([]string{"pod", "create", "-p", "8080:80", "--name", podName})
+ pod.WaitWithDefaultTimeout()
+ Expect(pod.ExitCode()).To(Equal(0))
+
+ ctrName := "testCtr"
+ session := podmanTest.Podman([]string{"run", "--name", ctrName, "-dt", "--pod", podName, ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ ps := podmanTest.Podman([]string{"ps", "--filter", fmt.Sprintf("name=%s", ctrName), "--format", "{{.Ports}}"})
+ ps.WaitWithDefaultTimeout()
+ Expect(ps.ExitCode()).To(Equal(0))
+ Expect(ps.OutputToString()).To(ContainSubstring("0.0.0.0:8080->80/tcp"))
+ })
})