summaryrefslogtreecommitdiff
path: root/test/e2e/pod_rm_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-11-25 14:17:45 +0100
committerGitHub <noreply@github.com>2019-11-25 14:17:45 +0100
commit9fb0adf479b6655d93316ece0cd702c4d4920fe1 (patch)
tree1d3289f8c48191ee57c803559d54564f81530ca7 /test/e2e/pod_rm_test.go
parent6187e724353f2d68943f912e0d8fc1d3d3c1f549 (diff)
parenta3d13fb286c39a2d9195b70e4265e5ac0deb6fd3 (diff)
downloadpodman-9fb0adf479b6655d93316ece0cd702c4d4920fe1.tar.gz
podman-9fb0adf479b6655d93316ece0cd702c4d4920fe1.tar.bz2
podman-9fb0adf479b6655d93316ece0cd702c4d4920fe1.zip
Merge pull request #4540 from vrothberg/systemd-improvements
podman rm/stop: add --allow-missing flag
Diffstat (limited to 'test/e2e/pod_rm_test.go')
-rw-r--r--test/e2e/pod_rm_test.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go
index de68e885a..c0277ca0d 100644
--- a/test/e2e/pod_rm_test.go
+++ b/test/e2e/pod_rm_test.go
@@ -186,4 +186,47 @@ var _ = Describe("Podman pod rm", func() {
result.WaitWithDefaultTimeout()
Expect(result.OutputToString()).To(BeEmpty())
})
+
+ It("podman rm bogus pod", func() {
+ session := podmanTest.Podman([]string{"pod", "rm", "bogus"})
+ session.WaitWithDefaultTimeout()
+ // TODO: `podman rm` returns 1 for a bogus container. Should the RC be consistent?
+ Expect(session.ExitCode()).To(Equal(125))
+ })
+
+ It("podman rm bogus pod and a running pod", func() {
+ _, ec, podid1 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
+
+ session := podmanTest.RunTopContainerInPod("test1", podid1)
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"pod", "rm", "bogus", "test1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+
+ session = podmanTest.Podman([]string{"pod", "rm", "test1", "bogus"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+ })
+
+ It("podman rm --ignore bogus pod and a running pod", func() {
+ SkipIfRemote()
+
+ _, ec, podid1 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
+
+ session := podmanTest.RunTopContainerInPod("test1", podid1)
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"pod", "rm", "--force", "--ignore", "bogus", "test1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"pod", "rm", "--ignore", "test1", "bogus"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
})