Merge pull request #24195 from edsantiago/055-cleanup

055-rm test: clean up a test, and document
This commit is contained in:
openshift-merge-bot[bot] 2024-10-08 12:34:53 +00:00 committed by GitHub
commit 07da6313c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -123,6 +123,8 @@ load helpers
assert "$output" !~ "$(safename)" "container should be removed"
}
# DO NOT CHANGE "sleep infinity"! This is how we get a container to
# remain in state "stopping" for long enough to check it.
function __run_healthcheck_container() {
run_podman run -d --name $1 \
--health-cmd /bin/false \
@ -187,17 +189,17 @@ function __run_healthcheck_container() {
for i in {1..10}; do
run_podman inspect $cname --format '{{.State.Status}}'
if [ "$output" = "stopping" ]; then
break
run_podman rm -f $cname
if kill -0 $pid; then
die "Container $cname process is still running (pid $pid)"
fi
return
fi
sleep 0.5
done
run_podman rm -f $cname
if kill -0 $pid; then
die "Container $cname process is still running (pid $pid)"
fi
die "Container never entered 'stopping' state"
}
# vim: filetype=sh