summaryrefslogtreecommitdiff
path: root/test/system/040-ps.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/system/040-ps.bats')
-rw-r--r--test/system/040-ps.bats32
1 files changed, 27 insertions, 5 deletions
diff --git a/test/system/040-ps.bats b/test/system/040-ps.bats
index 182d75547..63f57efdc 100644
--- a/test/system/040-ps.bats
+++ b/test/system/040-ps.bats
@@ -90,26 +90,48 @@ load helpers
is "${#lines[@]}" "1" "setup check: no storage containers at start of test"
# Force a buildah timeout; this leaves a buildah container behind
+ local t0=$SECONDS
PODMAN_TIMEOUT=5 run_podman 124 build -t thiswillneverexist - <<EOF
FROM $IMAGE
+RUN touch /intermediate.image.to.be.pruned
RUN sleep 30
EOF
+ local t1=$SECONDS
+ local delta_t=$((t1 - t0))
+ if [[ $delta_t -gt 10 ]]; then
+ # FIXME FIXME FIXME: when buildah issue 3544 gets fixed and vendored,
+ # change 'echo' to 'die'
+ echo "podman build did not get killed within 10 seconds (actual time: $delta_t seconds)"
+ fi
run_podman ps -a
- is "${#lines[@]}" "1" "podman ps -a does not see buildah container"
+ is "${#lines[@]}" "1" "podman ps -a does not see buildah containers"
run_podman ps --external -a
- is "${#lines[@]}" "2" "podman ps -a --external sees buildah container"
+ is "${#lines[@]}" "3" "podman ps -a --external sees buildah containers"
is "${lines[1]}" \
"[0-9a-f]\{12\} \+$IMAGE *buildah .* seconds ago .* storage .* ${PODMAN_TEST_IMAGE_NAME}-working-container" \
"podman ps --external"
- cid="${lines[1]:0:12}"
-
# 'rm -a' should be a NOP
run_podman rm -a
run_podman ps --external -a
- is "${#lines[@]}" "2" "podman ps -a --external sees buildah container"
+ is "${#lines[@]}" "3" "podman ps -a --external sees buildah containers"
+
+ # Cannot prune intermediate image as it's being used by a buildah
+ # container.
+ run_podman image prune -f
+ is "$output" "" "No image is pruned"
+
+ # --external for removing buildah containers.
+ run_podman image prune -f --external
+ is "${#lines[@]}" "1" "Image used by build container is pruned"
+
+ # One buildah container has been removed.
+ run_podman ps --external -a
+ is "${#lines[@]}" "2" "podman ps -a --external sees buildah containers"
+
+ cid="${lines[1]:0:12}"
# We can't rm it without -f, but podman should issue a helpful message
run_podman 2 rm "$cid"