diff options
author | Harald Albrecht <harald.albrecht@gmx.net> | 2022-09-06 18:38:28 +0200 |
---|---|---|
committer | Harald Albrecht <harald.albrecht@gmx.net> | 2022-09-06 20:29:44 +0200 |
commit | d759576ab3387321984da582810f3476dfa4df36 (patch) | |
tree | 86a53073033d1c829b16fd6156c7aae3334e1f25 /test | |
parent | 6da1eaf287c13a67dde688663b4dc8ed0cd868ad (diff) | |
download | podman-d759576ab3387321984da582810f3476dfa4df36.tar.gz podman-d759576ab3387321984da582810f3476dfa4df36.tar.bz2 podman-d759576ab3387321984da582810f3476dfa4df36.zip |
emit container labels also for container exited and exec died events
- adds unit test for container labels on container die event
- implements #15617
Signed-off-by: Harald Albrecht <harald.albrecht@gmx.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/090-events.bats | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/system/090-events.bats b/test/system/090-events.bats index cee0e23b0..cd1bf327b 100644 --- a/test/system/090-events.bats +++ b/test/system/090-events.bats @@ -194,3 +194,22 @@ EOF is "$(wc -l <$eventsFile)" "$(wc -l <<<$output)" "all events are returned" is "${lines[-2]}" ".* log-rotation $eventsFile" } + +# Prior to #15633, container labels would not appear in 'die' log events +@test "events - labels included in container die" { + skip_if_remote "remote does not support --events-backend" + local cname=c$(random_string 15) + local lname=l$(random_string 10) + local lvalue="v$(random_string 10) $(random_string 5)" + + run_podman 17 --events-backend=file run --rm \ + --name=$cname \ + --label=$lname="$lvalue" \ + $IMAGE sh -c 'exit 17' + run_podman --events-backend=file events \ + --filter=container=$cname \ + --filter=status=died \ + --stream=false \ + --format="{{.Attributes.$lname}}" + assert "$output" = "$lvalue" "podman-events output includes container label" +} |