summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-24 18:09:43 +0100
committerGitHub <noreply@github.com>2022-03-24 18:09:43 +0100
commitcaaaf07c1e9d30d91122a462e65cea5ca49391d0 (patch)
tree4071e2b5cb7801c4daabbd7ad1d1f784bf157f9a /test
parent32748492e919b9f3a7882dc2febc454d39c04c3e (diff)
parentb469bf5c05ce05e7b77852fa686f1e26dd59ec3e (diff)
downloadpodman-caaaf07c1e9d30d91122a462e65cea5ca49391d0.tar.gz
podman-caaaf07c1e9d30d91122a462e65cea5ca49391d0.tar.bz2
podman-caaaf07c1e9d30d91122a462e65cea5ca49391d0.zip
Merge pull request #13587 from giuseppe/clone-to-pod
container: allow clone to an existing pod
Diffstat (limited to 'test')
-rw-r--r--test/e2e/container_clone_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go
index bebc6872b..a327bb8ed 100644
--- a/test/e2e/container_clone_test.go
+++ b/test/e2e/container_clone_test.go
@@ -184,4 +184,41 @@ var _ = Describe("Podman container clone", func() {
Expect(ctrInspect.InspectContainerToJSON()[0].HostConfig.NetworkMode).Should(Equal(runInspect.InspectContainerToJSON()[0].HostConfig.NetworkMode))
})
+ It("podman container clone to a pod", func() {
+ createPod := podmanTest.Podman([]string{"pod", "create", "--share", "uts", "--name", "foo-pod"})
+ createPod.WaitWithDefaultTimeout()
+ Expect(createPod).To(Exit(0))
+
+ ctr := podmanTest.RunTopContainer("ctr")
+ ctr.WaitWithDefaultTimeout()
+ Expect(ctr).Should(Exit(0))
+
+ clone := podmanTest.Podman([]string{"container", "clone", "--name", "cloned", "--pod", "foo-pod", "ctr"})
+ clone.WaitWithDefaultTimeout()
+ Expect(clone).To(Exit(0))
+
+ ctrInspect := podmanTest.Podman([]string{"inspect", "cloned"})
+ ctrInspect.WaitWithDefaultTimeout()
+ Expect(ctrInspect).Should(Exit(0))
+
+ Expect(ctrInspect.InspectContainerToJSON()[0].Pod).Should(Equal(createPod.OutputToString()))
+
+ Expect(ctrInspect.InspectContainerToJSON()[0].HostConfig.NetworkMode).Should(Not(ContainSubstring("container:")))
+
+ createPod = podmanTest.Podman([]string{"pod", "create", "--share", "uts,net", "--name", "bar-pod"})
+ createPod.WaitWithDefaultTimeout()
+ Expect(createPod).To(Exit(0))
+
+ clone = podmanTest.Podman([]string{"container", "clone", "--name", "cloned2", "--pod", "bar-pod", "ctr"})
+ clone.WaitWithDefaultTimeout()
+ Expect(clone).To(Exit(0))
+
+ ctrInspect = podmanTest.Podman([]string{"inspect", "cloned2"})
+ ctrInspect.WaitWithDefaultTimeout()
+ Expect(ctrInspect).Should(Exit(0))
+
+ Expect(ctrInspect.InspectContainerToJSON()[0].Pod).Should(Equal(createPod.OutputToString()))
+
+ Expect(ctrInspect.InspectContainerToJSON()[0].HostConfig.NetworkMode).Should(ContainSubstring("container:"))
+ })
})