mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
libpod: pass down network options
do not pass network specific options through the network namespace. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -221,6 +221,29 @@ var _ = Describe("Podman run networking", func() {
|
||||
Expect(ncBusy).To(ExitWithError())
|
||||
})
|
||||
|
||||
It("podman run network expose host port 8081 to container port 8000 using rootlesskit port handler", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:port_handler=rootlesskit", "-dt", "-p", "8081:8000", ALPINE, "/bin/sh"})
|
||||
session.Wait(30)
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
ncBusy := SystemExec("nc", []string{"-l", "-p", "8081"})
|
||||
Expect(ncBusy).To(ExitWithError())
|
||||
})
|
||||
|
||||
It("podman run network expose host port 8082 to container port 8000 using slirp4netns port handler", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:port_handler=slirp4netns", "-dt", "-p", "8082:8000", ALPINE, "/bin/sh"})
|
||||
session.Wait(30)
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
ncBusy := SystemExec("nc", []string{"-l", "-p", "8082"})
|
||||
Expect(ncBusy).To(ExitWithError())
|
||||
})
|
||||
|
||||
It("podman run network expose host port 8080 to container port 8000 using invalid port handler", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:port_handler=invalid", "-dt", "-p", "8080:8000", ALPINE, "/bin/sh"})
|
||||
session.Wait(30)
|
||||
Expect(session.ExitCode()).To(Not(Equal(0)))
|
||||
})
|
||||
|
||||
It("podman run network expose ports in image metadata", func() {
|
||||
session := podmanTest.Podman([]string{"create", "-dt", "-P", nginx})
|
||||
session.Wait(90)
|
||||
|
Reference in New Issue
Block a user