diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-20 17:58:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 17:58:11 -0500 |
commit | 14443ccdfc19a7d719c63937ce76bfddf01f88e2 (patch) | |
tree | 3b3270237f9d3837668733e7364feb029037d437 /test/e2e | |
parent | fe4f9ba303affde0b838e19c862b45206ae2feed (diff) | |
parent | e7df73efadd36e2489954ee9a766a3fbfe4eafeb (diff) | |
download | podman-14443ccdfc19a7d719c63937ce76bfddf01f88e2.tar.gz podman-14443ccdfc19a7d719c63937ce76bfddf01f88e2.tar.bz2 podman-14443ccdfc19a7d719c63937ce76bfddf01f88e2.zip |
Merge pull request #9014 from rhatdan/rm
Fix handling of container remove
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/rm_test.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go index 524c07cc6..ca142d7f3 100644 --- a/test/e2e/rm_test.go +++ b/test/e2e/rm_test.go @@ -215,6 +215,40 @@ var _ = Describe("Podman rm", func() { Expect(result.ExitCode()).To(Equal(125)) }) + It("podman rm --all", func() { + session := podmanTest.Podman([]string{"create", ALPINE, "ls"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(podmanTest.NumberOfContainers()).To(Equal(1)) + + session = podmanTest.Podman([]string{"create", ALPINE, "ls"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(podmanTest.NumberOfContainers()).To(Equal(2)) + + session = podmanTest.Podman([]string{"rm", "--all"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(podmanTest.NumberOfContainers()).To(Equal(0)) + }) + + It("podman rm --ignore", func() { + session := podmanTest.Podman([]string{"create", ALPINE, "ls"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + cid := session.OutputToStringArray()[0] + Expect(podmanTest.NumberOfContainers()).To(Equal(1)) + + session = podmanTest.Podman([]string{"rm", "bogus", cid}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(1)) + + session = podmanTest.Podman([]string{"rm", "--ignore", "bogus", cid}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(podmanTest.NumberOfContainers()).To(Equal(0)) + }) + It("podman rm bogus container", func() { session := podmanTest.Podman([]string{"rm", "bogus"}) session.WaitWithDefaultTimeout() |