summaryrefslogtreecommitdiff
path: root/test/system/090-events.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/system/090-events.bats')
-rw-r--r--test/system/090-events.bats23
1 files changed, 18 insertions, 5 deletions
diff --git a/test/system/090-events.bats b/test/system/090-events.bats
index 06e28ec3a..8a9db41fa 100644
--- a/test/system/090-events.bats
+++ b/test/system/090-events.bats
@@ -6,9 +6,22 @@
load helpers
@test "events with a filter by label" {
- skip_if_remote "Need to talk to Ed on why this is failing on remote"
- rand=$(random_string 30)
- run_podman 0 run --label foo=bar --name test-$rand --rm $IMAGE ls
- run_podman 0 events --filter type=container --filter container=test-$rand --filter label=foo=bar --filter event=start --stream=false
- is "$output" ".*foo=bar" "check for label event on container with label"
+ skip_if_remote "FIXME: -remote does not include labels in event output"
+ cname=test-$(random_string 30 | tr A-Z a-z)
+ labelname=$(random_string 10)
+ labelvalue=$(random_string 15)
+
+ run_podman run --label $labelname=$labelvalue --name $cname --rm $IMAGE ls
+
+ expect=".* container start [0-9a-f]\+ (image=$IMAGE, name=$cname,.* ${labelname}=${labelvalue}"
+ run_podman events --filter type=container --filter container=$cname --filter label=${labelname}=${labelvalue} --filter event=start --stream=false
+ is "$output" "$expect" "filtering by container name and label"
+
+ # Same thing, but without the container-name filter
+ run_podman events --filter type=container --filter label=${labelname}=${labelvalue} --filter event=start --stream=false
+ is "$output" "$expect" "filtering just by label"
+
+ # Now filter just by container name, no label
+ run_podman events --filter type=container --filter container=$cname --filter event=start --stream=false
+ is "$output" "$expect" "filtering just by label"
}