summaryrefslogtreecommitdiff
path: root/test/system/040-ps.bats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-16 00:43:03 +0000
committerGitHub <noreply@github.com>2020-12-16 00:43:03 +0000
commit8333a9ee90078dd8cf1194f1df59bae70709bdf1 (patch)
tree3caaa819643d0a844dfa9ae2268242501066dc43 /test/system/040-ps.bats
parent66e979a892df7dc820e6ce7ada0e3a34619c172f (diff)
parent1345d0358b741093eae139d06fdd78d379070fa0 (diff)
downloadpodman-8333a9ee90078dd8cf1194f1df59bae70709bdf1.tar.gz
podman-8333a9ee90078dd8cf1194f1df59bae70709bdf1.tar.bz2
podman-8333a9ee90078dd8cf1194f1df59bae70709bdf1.zip
Merge pull request #8720 from edsantiago/bats
system tests: the catch-up game
Diffstat (limited to 'test/system/040-ps.bats')
-rw-r--r--test/system/040-ps.bats39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/system/040-ps.bats b/test/system/040-ps.bats
index 1ed2779b2..0447122b1 100644
--- a/test/system/040-ps.bats
+++ b/test/system/040-ps.bats
@@ -82,4 +82,43 @@ load helpers
run_podman rm -a
}
+@test "podman ps -a --storage" {
+ skip_if_remote "ps --storage does not work over remote"
+
+ # Setup: ensure that we have no hidden storage containers
+ run_podman ps --storage -a
+ is "${#lines[@]}" "1" "setup check: no storage containers at start of test"
+
+ # Force a buildah timeout; this leaves a buildah container behind
+ PODMAN_TIMEOUT=5 run_podman 124 build -t thiswillneverexist - <<EOF
+FROM $IMAGE
+RUN sleep 30
+EOF
+
+ run_podman ps -a
+ is "${#lines[@]}" "1" "podman ps -a does not see buildah container"
+
+ run_podman ps --storage -a
+ is "${#lines[@]}" "2" "podman ps -a --storage sees buildah container"
+ is "${lines[1]}" \
+ "[0-9a-f]\{12\} \+$IMAGE *buildah .* seconds ago .* storage .* ${PODMAN_TEST_IMAGE_NAME}-working-container" \
+ "podman ps --storage"
+
+ cid="${lines[1]:0:12}"
+
+ # 'rm -a' should be a NOP
+ run_podman rm -a
+ run_podman ps --storage -a
+ is "${#lines[@]}" "2" "podman ps -a --storage sees buildah container"
+
+ # This is what deletes the container
+ # FIXME: why doesn't "podman rm --storage $cid" do anything?
+ run_podman rm -f "$cid"
+
+ run_podman ps --storage -a
+ is "${#lines[@]}" "1" "storage container has been removed"
+}
+
+
+
# vim: filetype=sh