diff options
Diffstat (limited to 'test/e2e/run_staticip_test.go')
-rw-r--r-- | test/e2e/run_staticip_test.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go index b69d15cee..749835b47 100644 --- a/test/e2e/run_staticip_test.go +++ b/test/e2e/run_staticip_test.go @@ -4,6 +4,7 @@ import ( "fmt" "os" + . "github.com/containers/libpod/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) @@ -12,7 +13,7 @@ var _ = Describe("Podman run with --ip flag", func() { var ( tempdir string err error - podmanTest PodmanTest + podmanTest *PodmanTestIntegration ) BeforeEach(func() { @@ -20,8 +21,10 @@ var _ = Describe("Podman run with --ip flag", func() { if err != nil { os.Exit(1) } - podmanTest = PodmanCreate(tempdir) + podmanTest = PodmanTestCreate(tempdir) podmanTest.RestoreAllArtifacts() + // Cleanup the CNI networks used by the tests + os.RemoveAll("/var/lib/cni/networks/podman") }) AfterEach(func() { @@ -55,4 +58,13 @@ var _ = Describe("Podman run with --ip flag", func() { Expect(result.ExitCode()).To(Equal(0)) Expect(result.OutputToString()).To(ContainSubstring("10.88.64.128/16")) }) + + It("Podman run two containers with the same IP", func() { + result := podmanTest.Podman([]string{"run", "-d", "--ip", "10.88.64.128", ALPINE, "sleep", "999"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + result = podmanTest.Podman([]string{"run", "-ti", "--ip", "10.88.64.128", ALPINE, "ip", "addr"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).ToNot(Equal(0)) + }) }) |