summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2021-12-16 13:55:08 -0600
committerBrent Baude <bbaude@redhat.com>2021-12-16 14:11:50 -0600
commite88c21366d33dccb25ef292610b9894aa5087260 (patch)
tree0971d140df9f2d14ce0bf30e734f8c93f536193d /test
parent273da42af237dde44d34d215dfafa33f0b76d9ab (diff)
downloadpodman-e88c21366d33dccb25ef292610b9894aa5087260.tar.gz
podman-e88c21366d33dccb25ef292610b9894aa5087260.tar.bz2
podman-e88c21366d33dccb25ef292610b9894aa5087260.zip
Removed .service file for healthchecks
when a container with healthchecks exits due to stopping or failure, we need the cleanup process to remove both the timer file and the service file. Bz#:2024229 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/healthcheck_run_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index 6e4dc5bbf..c2084a6fd 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -242,4 +242,20 @@ var _ = Describe("Podman healthcheck run", func() {
Expect(ps.OutputToStringArray()).To(HaveLen(2))
Expect(ps.OutputToString()).To(ContainSubstring("hc"))
})
+
+ It("stopping and then starting a container with healthcheck cmd", func() {
+ session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--health-cmd", "[\"ls\", \"/foo\"]", ALPINE, "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ stop := podmanTest.Podman([]string{"stop", "-t0", "hc"})
+ stop.WaitWithDefaultTimeout()
+ Expect(stop).Should(Exit(0))
+
+ startAgain := podmanTest.Podman([]string{"start", "hc"})
+ startAgain.WaitWithDefaultTimeout()
+ Expect(startAgain).Should(Exit(0))
+ Expect(startAgain.OutputToString()).To(Equal("hc"))
+ Expect(startAgain.ErrorToString()).To(Equal(""))
+ })
})