diff options
author | Aditya R <arajan@redhat.com> | 2022-03-22 12:28:52 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-03-22 12:28:55 +0530 |
commit | 6d6bdabc8c3fd10f5770fb79d6d8702bc6cc4ec6 (patch) | |
tree | 4c15c264370da55678f89040904884f3b7e424d1 /test | |
parent | e034db16bf68c06c1ecf63addd033fcbd83090e3 (diff) | |
download | podman-6d6bdabc8c3fd10f5770fb79d6d8702bc6cc4ec6.tar.gz podman-6d6bdabc8c3fd10f5770fb79d6d8702bc6cc4ec6.tar.bz2 podman-6d6bdabc8c3fd10f5770fb79d6d8702bc6cc4ec6.zip |
healthcheck: stop showing wrong status when --no-healthcheck is set
Containers started with `--no-healthcheck` are configured to contain no
healthcheck and test configured as `NONE`. Podman shows wrong status as
such use cases.
Following commit fixes the faulty behavior of stauts field for
containers started with `--no-healthcheck`
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/healthcheck_run_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index 866edbf0e..757eaed20 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -54,6 +54,16 @@ var _ = Describe("Podman healthcheck run", func() { Expect(hc).Should(Exit(125)) }) + It("podman disable healthcheck with --no-healthcheck must not show starting on status", func() { + session := podmanTest.Podman([]string{"run", "-dt", "--no-healthcheck", "--name", "hc", healthcheck}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + hc := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.State.Health.Status}}", "hc"}) + hc.WaitWithDefaultTimeout() + Expect(hc).Should(Exit(0)) + Expect(hc.OutputToString()).To(Not(ContainSubstring("starting"))) + }) + It("podman run healthcheck and logs should contain healthcheck output", func() { session := podmanTest.Podman([]string{"run", "--name", "test-logs", "-dt", "--health-interval", "1s", "--health-cmd", "echo working", "busybox", "sleep", "3600"}) session.WaitWithDefaultTimeout() |