diff options
author | Ed Santiago <santiago@redhat.com> | 2020-10-20 12:41:11 -0600 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2020-10-26 13:29:15 -0600 |
commit | c93d4be41e6e79ff6b4bd69e1564d057d1de0469 (patch) | |
tree | efb55ad6076d9718b45c1ac1c4e5ddb5c5997869 /test/system/090-events.bats | |
parent | 3a62b4d6b70aaf68a443359319eb3fce7b101b87 (diff) | |
download | podman-c93d4be41e6e79ff6b4bd69e1564d057d1de0469.tar.gz podman-c93d4be41e6e79ff6b4bd69e1564d057d1de0469.tar.bz2 podman-c93d4be41e6e79ff6b4bd69e1564d057d1de0469.zip |
System tests: cleanup, make more robust
- run test: preserve --runtime test: use a random executable
path. And, clean up better.
- run test: "look up correct image name" test: use random
strings; test both without and with a :tag
- events test: use random label strings, add more filter tests
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/090-events.bats')
-rw-r--r-- | test/system/090-events.bats | 23 |
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" } |