summaryrefslogtreecommitdiff
path: root/test/system/055-rm.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-06-18 15:12:07 -0600
committerEd Santiago <santiago@redhat.com>2020-06-22 15:57:18 -0600
commitd4504e6f53895e9f0125b560d0e01e697e96ac2e (patch)
tree443e81411d9cdce3bc5248f5fad5c69bf178284d /test/system/055-rm.bats
parent22942e392df57d0ae5cc8ebdd27d060e43206d62 (diff)
downloadpodman-d4504e6f53895e9f0125b560d0e01e697e96ac2e.tar.gz
podman-d4504e6f53895e9f0125b560d0e01e697e96ac2e.tar.bz2
podman-d4504e6f53895e9f0125b560d0e01e697e96ac2e.zip
system tests: new rm, build tests
- rm: confirm 'rm' and 'rm -f' on running container - build: shotgun test of workdir, cmd, env, labels The new build test cd's to a temporary directory, which broke test invocations using a relative path (./bin/podman). Added code to detect relative paths and convert them to absolute. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/055-rm.bats')
-rw-r--r--test/system/055-rm.bats12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/system/055-rm.bats b/test/system/055-rm.bats
index 8ef8a119e..6a381a187 100644
--- a/test/system/055-rm.bats
+++ b/test/system/055-rm.bats
@@ -21,6 +21,18 @@ load helpers
run_podman 125 inspect $rand
}
+@test "podman rm - running container, w/o and w/ force" {
+ run_podman run -d $IMAGE sleep 5
+ cid="$output"
+
+ # rm should fail
+ run_podman 2 rm $cid
+ is "$output" "Error: cannot remove container $cid as it is running - running or paused containers cannot be removed without force: container state improper" "error message"
+
+ # rm -f should succeed
+ run_podman rm -f $cid
+}
+
# 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'