From 03716cf7f331fa5b5ffab23dcc863bedd66b5dfc Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 6 Mar 2019 12:12:35 -0600 Subject: healtcheck phase 2 integration of healthcheck into create and run as well as inspect. healthcheck enhancements are as follows: * add the following options to create|run so that non-docker images can define healthchecks at the container level. * --healthcheck-command * --healthcheck-retries * --healthcheck-interval * --healthcheck-start-period * podman create|run --healthcheck-command=none disables healthcheck as described by an image. * the healthcheck itself and the healthcheck "history" can now be observed in podman inspect * added the wiring for healthcheck history which logs the health history of the container, the current failed streak attempts, and log entries for the last five attempts which themselves have start and stop times, result, and a 500 character truncated (if needed) log of stderr/stdout. The timings themselves are not implemented in this PR but will be in future enablement (i.e. next). Signed-off-by: baude --- test/e2e/run_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/e2e') diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 9d89905c2..e0d2e21b7 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -719,4 +719,28 @@ USER mail` Expect(session.OutputToString()).To(Not(ContainSubstring("/dev/shm type tmpfs (ro,"))) }) + + It("podman run with bad healthcheck interval", func() { + session := podmanTest.Podman([]string{"run", "-dt", "--healthcheck-cmd", "foo", "--healthcheck-interval", "0.5s", ALPINE, "top"}) + session.Wait() + Expect(session.ExitCode()).ToNot(Equal(0)) + }) + + It("podman run with bad healthcheck retries", func() { + session := podmanTest.Podman([]string{"run", "-dt", "--healthcheck-cmd", "foo", "--healthcheck-retries", "0", ALPINE, "top"}) + session.Wait() + Expect(session.ExitCode()).ToNot(Equal(0)) + }) + + It("podman run with bad healthcheck timeout", func() { + session := podmanTest.Podman([]string{"run", "-dt", "--healthcheck-cmd", "foo", "--healthcheck-timeout", "0s", ALPINE, "top"}) + session.Wait() + Expect(session.ExitCode()).ToNot(Equal(0)) + }) + + It("podman run with bad healthcheck start-period", func() { + session := podmanTest.Podman([]string{"run", "-dt", "--healthcheck-cmd", "foo", "--healthcheck-start-period", "-1s", ALPINE, "top"}) + session.Wait() + Expect(session.ExitCode()).ToNot(Equal(0)) + }) }) -- cgit v1.2.3-54-g00ecf