aboutsummaryrefslogtreecommitdiff
path: root/test/system/220-healthcheck.bats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-10-07 19:27:42 +0200
committerGitHub <noreply@github.com>2022-10-07 19:27:42 +0200
commit5908996738daf0fe7463f21d58affc60d279466b (patch)
treedd602d88a252f307dc7b47ac0620baf7d77b4d81 /test/system/220-healthcheck.bats
parent2062ab9db4d59623e56dd58169735d9fba1c0838 (diff)
parent02040089a6c3eb96f231974cdaa4158dc894b5eb (diff)
downloadpodman-5908996738daf0fe7463f21d58affc60d279466b.tar.gz
podman-5908996738daf0fe7463f21d58affc60d279466b.tar.bz2
podman-5908996738daf0fe7463f21d58affc60d279466b.zip
Merge pull request #16084 from vrothberg/health-check-fixHEADmain
health checks: make on-failure action retry aware
Diffstat (limited to 'test/system/220-healthcheck.bats')
-rw-r--r--test/system/220-healthcheck.bats9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/system/220-healthcheck.bats b/test/system/220-healthcheck.bats
index a1b24d293..8e14adcec 100644
--- a/test/system/220-healthcheck.bats
+++ b/test/system/220-healthcheck.bats
@@ -28,10 +28,11 @@ function _check_health {
--health-cmd /healthcheck \
--health-interval 1s \
--health-retries 3 \
+ --health-on-failure=kill \
healthcheck_i
run_podman inspect healthcheck_c --format "{{.Config.HealthcheckOnFailureAction}}"
- is "$output" "none" "default on-failure action is none"
+ is "$output" "kill" "on-failure action is set to kill"
# We can't check for 'starting' because a 1-second interval is too
# short; it could run healthcheck before we get to our first check.
@@ -67,9 +68,8 @@ Log[-1].ExitCode | 1
Log[-1].Output | \"Uh-oh on stdout!\\\nUh-oh on stderr!\"
"
- # healthcheck should now fail, with exit status 1 and 'unhealthy' output
- run_podman 1 healthcheck run healthcheck_c
- is "$output" "unhealthy" "output from 'podman healthcheck run'"
+ # now the on-failure should kick in and kill the container
+ podman wait healthcheck_c
# Clean up
run_podman rm -t 0 -f healthcheck_c
@@ -95,6 +95,7 @@ Log[-1].Output | \"Uh-oh on stdout!\\\nUh-oh on stderr!\"
# Run that healthcheck image.
run_podman run -d --name $ctr \
--health-cmd /healthcheck \
+ --health-retries=1 \
--health-on-failure=$policy \
$img