diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-12-02 08:28:30 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-12-02 18:38:35 -0500 |
commit | ee418c8565a46fc500c5e17067966a478efd4197 (patch) | |
tree | 6c35050dda33abc15796252eeed9e8d71132edfd /test/e2e/run_networking_test.go | |
parent | 7210b86d9ee5aa38a07829e58038049d224cad61 (diff) | |
download | podman-ee418c8565a46fc500c5e17067966a478efd4197.tar.gz podman-ee418c8565a46fc500c5e17067966a478efd4197.tar.bz2 podman-ee418c8565a46fc500c5e17067966a478efd4197.zip |
Support --network=default as if it was private
Docker defines an option of "default" which means to
use the default network. We should support this with
the same code path as --network="".
This is important for compatibility with the Docker API.
Fixes: https://github.com/containers/podman/issues/8544
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/run_networking_test.go')
-rw-r--r-- | test/e2e/run_networking_test.go | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 3e80e953e..3fb00a28b 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -49,9 +49,28 @@ var _ = Describe("Podman run networking", func() { Expect(session.ExitCode()).To(Equal(0)) }) + It("podman run network connection with default", func() { + session := podmanTest.Podman([]string{"run", "--network", "default", ALPINE, "wget", "www.podman.io"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) + + It("podman run network connection with none", func() { + session := podmanTest.Podman([]string{"run", "--network", "none", ALPINE, "wget", "www.podman.io"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(1)) + Expect(session.ErrorToString()).To(ContainSubstring("wget: bad address 'www.podman.io'")) + }) + + It("podman run network connection with private", func() { + session := podmanTest.Podman([]string{"run", "--network", "private", ALPINE, "wget", "www.podman.io"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) + It("podman run network connection with loopback", func() { - session := podmanTest.Podman([]string{"run", "-dt", "--network", "host", ALPINE, "wget", "www.podman.io"}) - session.Wait(90) + session := podmanTest.Podman([]string{"run", "--network", "host", ALPINE, "wget", "www.podman.io"}) + session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) |