summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-06-01 09:33:02 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-06-02 16:38:54 +0200
commitce5c3b55434501f70b8ba8b0e2a9db1cce2e9360 (patch)
treea72f679d1b25a43ac430dea94966cedad43004a5 /test/system
parent4b202ae29bbcbc00bcd0e9128b8e0a44080916c6 (diff)
downloadpodman-ce5c3b55434501f70b8ba8b0e2a9db1cce2e9360.tar.gz
podman-ce5c3b55434501f70b8ba8b0e2a9db1cce2e9360.tar.bz2
podman-ce5c3b55434501f70b8ba8b0e2a9db1cce2e9360.zip
[v.3.2] events: support disjunctive filters
While different filters are applied in conjunction, the same filter (but with different values) should be applied in disjunction. This allows, for instance, to query the events of two containers. Fixes: #10507 Backport-of: commit 37f39eefee72ec4fb6c6bd71642e9d384c448387 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/090-events.bats29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/system/090-events.bats b/test/system/090-events.bats
index 19bee5506..09c2d0c10 100644
--- a/test/system/090-events.bats
+++ b/test/system/090-events.bats
@@ -61,3 +61,32 @@ load helpers
.*image remove $imageID $tag.*" \
"podman events"
}
+
+function _events_disjunctive_filters() {
+ local backend=$1
+
+ # Regression test for #10507: make sure that filters with the same key are
+ # applied in disjunction.
+ t0=$(date --iso-8601=seconds)
+ run_podman $backend run --name foo --rm $IMAGE ls
+ run_podman $backend run --name bar --rm $IMAGE ls
+ run_podman $backend events --stream=false --since=$t0 --filter container=foo --filter container=bar --filter event=start
+ is "$output" ".* container start .* name=foo.*
+.* container start .* name=bar.*"
+}
+
+@test "events with disjunctive filters - file" {
+ skip_if_remote "remote does not support --events-backend"
+ _events_disjunctive_filters --events-backend=file
+}
+
+@test "events with disjunctive filters - journald" {
+ skip_if_remote "remote does not support --events-backend"
+ _events_disjunctive_filters --events-backend=journald
+}
+
+@test "events with disjunctive filters - default" {
+ # NOTE: the last event for bar doesn't show up reliably.
+ skip_if_remote "FIXME #10529: remote events lose data"
+ _events_disjunctive_filters ""
+}