summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2022-04-20 21:40:47 -0400
committercdoern <cbdoer23@g.holycross.edu>2022-04-21 15:00:32 -0400
commit5375401960cf0a9b716bb18eacdb07ffbb0e6da1 (patch)
treeb35639c169b65c5e5d44ccfa3e9e75fe8aa4f47f /test
parent02ab86a68aa3c510dc8be8aefbd1029efb657438 (diff)
downloadpodman-5375401960cf0a9b716bb18eacdb07ffbb0e6da1.tar.gz
podman-5375401960cf0a9b716bb18eacdb07ffbb0e6da1.tar.bz2
podman-5375401960cf0a9b716bb18eacdb07ffbb0e6da1.zip
podman container clone -f
add the option -f to force remove the parent container if --destory is specified resolves #13917 Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/container_clone_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go
index 1d5944d1a..1ff4b3b5f 100644
--- a/test/e2e/container_clone_test.go
+++ b/test/e2e/container_clone_test.go
@@ -235,4 +235,36 @@ var _ = Describe("Podman container clone", func() {
Expect(ctrInspect.InspectContainerToJSON()[0].HostConfig.NetworkMode).Should(ContainSubstring("container:"))
})
+
+ It("podman container clone --destroy --force test", func() {
+ create := podmanTest.Podman([]string{"create", ALPINE})
+ create.WaitWithDefaultTimeout()
+ Expect(create).To(Exit(0))
+ clone := podmanTest.Podman([]string{"container", "clone", "--destroy", create.OutputToString()})
+ clone.WaitWithDefaultTimeout()
+ Expect(clone).To(Exit(0))
+
+ inspect := podmanTest.Podman([]string{"inspect", create.OutputToString()})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).ToNot(Exit(0))
+
+ run := podmanTest.Podman([]string{"run", "-dt", ALPINE})
+ run.WaitWithDefaultTimeout()
+ Expect(run).To(Exit(0))
+ clone = podmanTest.Podman([]string{"container", "clone", "--destroy", "-f", run.OutputToString()})
+ clone.WaitWithDefaultTimeout()
+ Expect(clone).To(Exit(0))
+
+ inspect = podmanTest.Podman([]string{"inspect", run.OutputToString()})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).ToNot(Exit(0))
+
+ run = podmanTest.Podman([]string{"run", "-dt", ALPINE})
+ run.WaitWithDefaultTimeout()
+ Expect(run).To(Exit(0))
+ clone = podmanTest.Podman([]string{"container", "clone", "-f", run.OutputToString()})
+ clone.WaitWithDefaultTimeout()
+ Expect(clone).ToNot(Exit(0))
+
+ })
})