From 1585b175dbf47e7ee0d5a26600aaec898ec5c26b Mon Sep 17 00:00:00 2001 From: cdoern Date: Thu, 28 Apr 2022 22:37:11 -0400 Subject: pass networks to container clone since the network config is a string map, json.unmarshal does not recognize the config and spec as the same entity, need to map this option manually resolves #13713 Signed-off-by: cdoern --- test/e2e/container_clone_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/e2e') diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go index c47a89332..075ed8264 100644 --- a/test/e2e/container_clone_test.go +++ b/test/e2e/container_clone_test.go @@ -267,4 +267,30 @@ var _ = Describe("Podman container clone", func() { Expect(clone).ToNot(Exit(0)) }) + + It("podman container clone network passing", func() { + networkCreate := podmanTest.Podman([]string{"network", "create", "testing123"}) + networkCreate.WaitWithDefaultTimeout() + defer podmanTest.removeNetwork("testing123") + Expect(networkCreate).To(Exit(0)) + run := podmanTest.Podman([]string{"run", "--network", "bridge", "-dt", ALPINE}) + run.WaitWithDefaultTimeout() + Expect(run).To(Exit(0)) + + connect := podmanTest.Podman([]string{"network", "connect", "testing123", run.OutputToString()}) + connect.WaitWithDefaultTimeout() + Expect(connect).To(Exit(0)) + + clone := podmanTest.Podman([]string{"container", "clone", run.OutputToString()}) + clone.WaitWithDefaultTimeout() + Expect(clone).To(Exit(0)) + + inspect := podmanTest.Podman([]string{"inspect", clone.OutputToString()}) + inspect.WaitWithDefaultTimeout() + Expect(inspect).To(Exit(0)) + Expect(inspect.InspectContainerToJSON()[0].NetworkSettings.Networks).To(HaveLen(2)) + _, ok := inspect.InspectContainerToJSON()[0].NetworkSettings.Networks["testing123"] + Expect(ok).To(BeTrue()) + + }) }) -- cgit v1.2.3-54-g00ecf