diff options
| author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-10-07 19:27:42 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-07 19:27:42 +0200 | 
| commit | 5908996738daf0fe7463f21d58affc60d279466b (patch) | |
| tree | dd602d88a252f307dc7b47ac0620baf7d77b4d81 /test/system | |
| parent | 2062ab9db4d59623e56dd58169735d9fba1c0838 (diff) | |
| parent | 02040089a6c3eb96f231974cdaa4158dc894b5eb (diff) | |
| download | podman-main.tar.gz podman-main.tar.bz2 podman-main.zip | |
health checks: make on-failure action retry aware
Diffstat (limited to 'test/system')
| -rw-r--r-- | test/system/220-healthcheck.bats | 9 | ||||
| -rw-r--r-- | test/system/250-systemd.bats | 1 | 
2 files changed, 6 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 diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index ddec3a492..5526728b6 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -318,6 +318,7 @@ LISTEN_FDNAMES=listen_fdnames" | sort)      run_podman create --name $cname      \                 --health-cmd /healthcheck \                 --health-on-failure=kill  \ +               --health-retries=1        \                 --restart=on-failure      \                 $img | 
