summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-10-11 15:02:04 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-10-11 15:02:04 -0400
commit7580c227348af2a0906a692ad6a44348dc3eefbc (patch)
tree9a6e70df21aef599654261114875e2a78c15e062 /test/system
parent00ebf3cf1885fc95c3c36021e717db1f1e7d63be (diff)
downloadpodman-7580c227348af2a0906a692ad6a44348dc3eefbc.tar.gz
podman-7580c227348af2a0906a692ad6a44348dc3eefbc.tar.bz2
podman-7580c227348af2a0906a692ad6a44348dc3eefbc.zip
Remove a volume with --force if container is running
Currently we are not passing the force flag down to the removal of the running container. If the container is running, and we set --force when removing the volume, the container should be stopped. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/160-volumes.bats8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/system/160-volumes.bats b/test/system/160-volumes.bats
index 490d635e5..7128f1b65 100644
--- a/test/system/160-volumes.bats
+++ b/test/system/160-volumes.bats
@@ -97,6 +97,14 @@ Labels.l | $mylabel
run_podman volume rm $myvolume
}
+# Removing volumes with --force
+@test "podman volume rm --force" {
+ run_podman run -d --volume myvol:/myvol $IMAGE top
+ cid=$output
+ run_podman 2 volume rm myvol
+ is "$output" "Error: volume myvol is being used by the following container(s): $cid: volume is being used" "should error since container is running"
+ run_podman volume rm myvol --force
+}
# Running scripts (executables) from a volume
@test "podman volume: exec/noexec" {