event backend none: return an error when reading events

podman --events-backend none events should return with an error since it
will never be able to actually list events.

Fixes part three of #15688

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-09-09 11:43:20 +02:00
parent c5bdb6afe7
commit 138b09c7e2
4 changed files with 38 additions and 25 deletions

View File

@@ -217,3 +217,12 @@ EOF
--format="{{.Attributes.$lname}}"
assert "$output" = "$lvalue" "podman-events output includes container label"
}
@test "events - backend none should error" {
skip_if_remote "remote does not support --events-backend"
run_podman 125 --events-backend none events
is "$output" "Error: cannot read events with the \"none\" backend" "correct error message"
run_podman 125 --events-backend none events --stream=false
is "$output" "Error: cannot read events with the \"none\" backend" "correct error message"
}