diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-29 13:52:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-29 13:52:47 -0400 |
commit | e0b93af70f1f1a183c99a350c6e588898b45c717 (patch) | |
tree | 77271b38b5e61bff58ab3ba6f8e58b0ab48645cb /test | |
parent | c682ca3d35a3e4f9265e10dc9898cbe3ac3d35a2 (diff) | |
parent | 3601b96600807214d74b9c77c614fa03bfae30a8 (diff) | |
download | podman-e0b93af70f1f1a183c99a350c6e588898b45c717.tar.gz podman-e0b93af70f1f1a183c99a350c6e588898b45c717.tar.bz2 podman-e0b93af70f1f1a183c99a350c6e588898b45c717.zip |
Merge pull request #6808 from mheon/allow_empty_hostport
Allow empty host port in --publish flag
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_networking_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index afba12ccd..cdfbd5530 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -184,6 +184,30 @@ var _ = Describe("Podman run networking", func() { Expect(inspectOut[0].NetworkSettings.Ports["80/tcp"][0].HostIP).To(Equal("")) }) + It("podman run -p 127.0.0.1::8080/udp", func() { + name := "testctr" + session := podmanTest.Podman([]string{"create", "-t", "-p", "127.0.0.1::8080/udp", "--name", name, ALPINE, "/bin/sh"}) + session.WaitWithDefaultTimeout() + inspectOut := podmanTest.InspectContainer(name) + Expect(len(inspectOut)).To(Equal(1)) + Expect(len(inspectOut[0].NetworkSettings.Ports)).To(Equal(1)) + Expect(len(inspectOut[0].NetworkSettings.Ports["8080/udp"])).To(Equal(1)) + Expect(inspectOut[0].NetworkSettings.Ports["8080/udp"][0].HostPort).To(Not(Equal("8080"))) + Expect(inspectOut[0].NetworkSettings.Ports["8080/udp"][0].HostIP).To(Equal("127.0.0.1")) + }) + + It("podman run -p :8080", func() { + name := "testctr" + session := podmanTest.Podman([]string{"create", "-t", "-p", ":8080", "--name", name, ALPINE, "/bin/sh"}) + session.WaitWithDefaultTimeout() + inspectOut := podmanTest.InspectContainer(name) + Expect(len(inspectOut)).To(Equal(1)) + Expect(len(inspectOut[0].NetworkSettings.Ports)).To(Equal(1)) + Expect(len(inspectOut[0].NetworkSettings.Ports["8080/tcp"])).To(Equal(1)) + Expect(inspectOut[0].NetworkSettings.Ports["8080/tcp"][0].HostPort).To(Not(Equal("8080"))) + Expect(inspectOut[0].NetworkSettings.Ports["8080/tcp"][0].HostIP).To(Equal("")) + }) + It("podman run network expose host port 80 to container port 8000", func() { SkipIfRootless() session := podmanTest.Podman([]string{"run", "-dt", "-p", "80:8000", ALPINE, "/bin/sh"}) |