diff options
author | Antonio Ojea <aojea@redhat.com> | 2020-11-09 23:35:04 +0100 |
---|---|---|
committer | Antonio Ojea <aojea@redhat.com> | 2020-11-10 11:03:56 +0100 |
commit | 98d770747e13f4286958a7d68f1c96223ca96c98 (patch) | |
tree | 9d1b49bc90ec027a2d8c732fb4fd233024496cc8 | |
parent | e7a72d72fd598b0de3c1049c91cd788440c08f2d (diff) | |
download | podman-98d770747e13f4286958a7d68f1c96223ca96c98.tar.gz podman-98d770747e13f4286958a7d68f1c96223ca96c98.tar.bz2 podman-98d770747e13f4286958a7d68f1c96223ca96c98.zip |
add e2e test for network with same subnet
add e2e test that checks that is not possible to create
different networks with the same subnet, in IPv6 neither
in IPv4
Signed-off-by: Antonio Ojea <aojea@redhat.com>
-rw-r--r-- | test/e2e/network_create_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go index 5391b2940..38e0c0bbf 100644 --- a/test/e2e/network_create_test.go +++ b/test/e2e/network_create_test.go @@ -304,6 +304,29 @@ var _ = Describe("Podman network create", func() { Expect(ncFail).To(ExitWithError()) }) + It("podman network create two networks with same subnet should fail", func() { + nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.13.0/24", "subnet1"}) + nc.WaitWithDefaultTimeout() + Expect(nc.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork("subnet1") + + ncFail := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.13.0/24", "subnet2"}) + ncFail.WaitWithDefaultTimeout() + Expect(ncFail).To(ExitWithError()) + }) + + It("podman network create two IPv6 networks with same subnet should fail", func() { + SkipIfRootless("FIXME It needs the ip6tables modules loaded") + nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:4:4:4::/64", "--ipv6", "subnet1v6"}) + nc.WaitWithDefaultTimeout() + Expect(nc.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork("subnet1v6") + + ncFail := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:4:4:4::/64", "--ipv6", "subnet2v6"}) + ncFail.WaitWithDefaultTimeout() + Expect(ncFail).To(ExitWithError()) + }) + It("podman network create with invalid network name", func() { nc := podmanTest.Podman([]string{"network", "create", "foo "}) nc.WaitWithDefaultTimeout() |