aboutsummaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-12-23 06:41:55 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-01-11 14:33:54 -0500
commit8f2358eeaa59fe369eebc6186403f95c2d66e49b (patch)
treea454ef259ab28f85b17f53b3273725480aa78515 /test/system
parentc4142ce0cfff792092bf420950b1985058cc241c (diff)
downloadpodman-8f2358eeaa59fe369eebc6186403f95c2d66e49b.tar.gz
podman-8f2358eeaa59fe369eebc6186403f95c2d66e49b.tar.bz2
podman-8f2358eeaa59fe369eebc6186403f95c2d66e49b.zip
Add podman rm --depend
This option causes Podman to not only remove the specified containers but all of the containers that depend on the specified containers. Fixes: https://github.com/containers/podman/issues/10360 Also ran codespell on the code Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/001-basic.bats2
-rw-r--r--test/system/055-rm.bats12
2 files changed, 13 insertions, 1 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 23489c1b5..9b0a71285 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -41,7 +41,7 @@ function setup() {
# This one must fail
run_podman 125 --context=swarm version
is "$output" \
- "Error: Podman does not support swarm, the only --context value allowed is \"default\"" \
+ "Error: podman does not support swarm, the only --context value allowed is \"default\"" \
"--context=default or fail"
}
diff --git a/test/system/055-rm.bats b/test/system/055-rm.bats
index 7fe81c084..69663fafa 100644
--- a/test/system/055-rm.bats
+++ b/test/system/055-rm.bats
@@ -58,6 +58,18 @@ load helpers
run_podman rm -af
}
+@test "podman rm --depend" {
+ run_podman create $IMAGE
+ dependCid=$output
+ run_podman create --net=container:$dependCid $IMAGE
+ cid=$output
+ run_podman 125 rm $dependCid
+ is "$output" "Error: container $dependCid has dependent containers which must be removed before it:.*" "Fail to remove because of dependencies"
+ run_podman rm --depend $dependCid
+ is "$output" ".*$cid" "Container should have been removed"
+ is "$output" ".*$dependCid" "Depend container should have been removed"
+}
+
# I'm sorry! This test takes 13 seconds. There's not much I can do about it,
# please know that I think it's justified: podman 1.5.0 had a strange bug
# in with exit status was not preserved on some code paths with 'rm -f'