summaryrefslogtreecommitdiff
path: root/test/e2e/volume_rm_test.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-09-29 10:05:53 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-09-29 15:52:43 -0400
commit22474095abe39c14c902650b08002c0bc89e7e6a (patch)
treee601964f926bf5e6b6684d4dae796d7282974f56 /test/e2e/volume_rm_test.go
parent12f173f4732d50a85bf4875807597d2fd0e92cc0 (diff)
downloadpodman-22474095abe39c14c902650b08002c0bc89e7e6a.tar.gz
podman-22474095abe39c14c902650b08002c0bc89e7e6a.tar.bz2
podman-22474095abe39c14c902650b08002c0bc89e7e6a.zip
Fix handling of remove of bogus volumes, networks and Pods
In podman containers rm and podman images rm, the commands exit with error code 1 if the object does not exists. This PR implements similar functionality to volumes, networks, and Pods. Similarly if volumes or Networks are in use by other containers, and return exit code 2. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/volume_rm_test.go')
-rw-r--r--test/e2e/volume_rm_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/e2e/volume_rm_test.go b/test/e2e/volume_rm_test.go
index a072bc824..cdced1f13 100644
--- a/test/e2e/volume_rm_test.go
+++ b/test/e2e/volume_rm_test.go
@@ -55,7 +55,7 @@ var _ = Describe("Podman volume rm", func() {
session = podmanTest.Podman([]string{"volume", "rm", "myvol"})
session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
+ Expect(session.ExitCode()).To(Equal(2))
Expect(session.ErrorToString()).To(ContainSubstring(cid))
session = podmanTest.Podman([]string{"volume", "rm", "-f", "myvol"})
@@ -70,6 +70,12 @@ var _ = Describe("Podman volume rm", func() {
podmanTest.Cleanup()
})
+ It("podman volume remove bogus", func() {
+ session := podmanTest.Podman([]string{"volume", "rm", "bogus"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(1))
+ })
+
It("podman rm with --all flag", func() {
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
session.WaitWithDefaultTimeout()