aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2022-08-24 13:27:17 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-09-22 14:18:56 -0400
commit6ee582315bfba8db13541406f6def26ecd8f6aeb (patch)
treebc958f363aa5d40069baf9fb9933d189ba0e7a4a /test
parent08993516a939576fa009db6e7ed32524026a822d (diff)
downloadpodman-6ee582315bfba8db13541406f6def26ecd8f6aeb.tar.gz
podman-6ee582315bfba8db13541406f6def26ecd8f6aeb.tar.bz2
podman-6ee582315bfba8db13541406f6def26ecd8f6aeb.zip
Events for containers in pods now include the pod's ID
This allows tools like Cockpit to know that the pod in question has also been updated, so they can refresh the list of containers in the pod. Fixes #15408 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/27-containersEvents.at2
-rw-r--r--test/e2e/events_test.go12
2 files changed, 12 insertions, 2 deletions
diff --git a/test/apiv2/27-containersEvents.at b/test/apiv2/27-containersEvents.at
index e0a66e0ac..a5b5b24a3 100644
--- a/test/apiv2/27-containersEvents.at
+++ b/test/apiv2/27-containersEvents.at
@@ -20,7 +20,7 @@ t GET "libpod/events?stream=false&since=$START" 200 \
t GET "libpod/events?stream=false&since=$START" 200 \
'select(.status | contains("start")).Action=start' \
- 'select(.status | contains("start")).HealthStatus='\
+ 'select(.status | contains("start")).HealthStatus=null'\
# compat api, uses status=die (#12643)
t GET "events?stream=false&since=$START" 200 \
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index bba42c3f4..c76919581 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -212,6 +212,16 @@ var _ = Describe("Podman events", func() {
Expect(result).Should(Exit(0))
Expect(result.OutputToStringArray()).To(HaveLen(1))
Expect(result.OutputToString()).To(ContainSubstring("create"))
+
+ ctrName := "testCtr"
+ run := podmanTest.Podman([]string{"create", "--pod", id, "--name", ctrName, ALPINE, "top"})
+ run.WaitWithDefaultTimeout()
+ Expect(run).Should(Exit(0))
+
+ result2 := podmanTest.Podman([]string{"events", "--stream=false", "--filter", fmt.Sprintf("container=%s", ctrName), "--since", "30s"})
+ result2.WaitWithDefaultTimeout()
+ Expect(result2).Should(Exit(0))
+ Expect(result2.OutputToString()).To(ContainSubstring(fmt.Sprintf("pod_id=%s", id)))
})
It("podman events health_status generated", func() {
@@ -229,7 +239,7 @@ var _ = Describe("Podman events", func() {
time.Sleep(1 * time.Second)
}
- result := podmanTest.Podman([]string{"events", "--stream=false", "--filter", "event=health_status"})
+ result := podmanTest.Podman([]string{"events", "--stream=false", "--filter", "event=health_status", "--since", "1m"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(len(result.OutputToStringArray())).To(BeNumerically(">=", 1), "Number of health_status events")