summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-27 17:49:27 +0000
committerGitHub <noreply@github.com>2022-06-27 17:49:27 +0000
commit278afae1de55a2951b2a4810b100d14e5647977b (patch)
tree127c92338c22c1763c4564d43ba1c6eed34ac9c5 /test
parented2afb2059744defccd40894b5f23e3803f6b3c5 (diff)
parent0c1a3b70f5f1b8a3f8d336c6576518fae26c37cf (diff)
downloadpodman-278afae1de55a2951b2a4810b100d14e5647977b.tar.gz
podman-278afae1de55a2951b2a4810b100d14e5647977b.tar.bz2
podman-278afae1de55a2951b2a4810b100d14e5647977b.zip
Merge pull request #14705 from jakecorrenti/show-health-status-event
Show Health Status events
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/27-containersEvents.at4
-rw-r--r--test/e2e/events_test.go21
2 files changed, 25 insertions, 0 deletions
diff --git a/test/apiv2/27-containersEvents.at b/test/apiv2/27-containersEvents.at
index a86f2e353..e0a66e0ac 100644
--- a/test/apiv2/27-containersEvents.at
+++ b/test/apiv2/27-containersEvents.at
@@ -18,6 +18,10 @@ t GET "libpod/events?stream=false&since=$START" 200 \
'select(.status | contains("died")).Action=died' \
'select(.status | contains("died")).Actor.Attributes.containerExitCode=1'
+t GET "libpod/events?stream=false&since=$START" 200 \
+ 'select(.status | contains("start")).Action=start' \
+ 'select(.status | contains("start")).HealthStatus='\
+
# compat api, uses status=die (#12643)
t GET "events?stream=false&since=$START" 200 \
'select(.status | contains("start")).Action=start' \
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index 725118ab0..528fa143d 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -216,4 +216,25 @@ var _ = Describe("Podman events", func() {
Expect(result.OutputToString()).To(ContainSubstring("create"))
})
+ It("podman events health_status generated", func() {
+ session := podmanTest.Podman([]string{"run", "--name", "test-hc", "-dt", "--health-cmd", "echo working", "busybox"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ for i := 0; i < 5; i++ {
+ hc := podmanTest.Podman([]string{"healthcheck", "run", "test-hc"})
+ hc.WaitWithDefaultTimeout()
+ exitCode := hc.ExitCode()
+ if exitCode == 0 || i == 4 {
+ break
+ }
+ time.Sleep(1 * time.Second)
+ }
+
+ result := podmanTest.Podman([]string{"events", "--stream=false", "--filter", "event=health_status"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(len(result.OutputToStringArray())).To(BeNumerically(">=", 1), "Number of health_status events")
+ })
+
})