apiv2 test: add regression test for #12904

Add a regression test for issue #12904 to make sure that attaching with
logs=true to the compact endpoint does not blow up.  Note that I did not
find a way to test the output (i.e., '123'); logs are sent in a binary
format and I did not find a way to compare the control characters.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2022-01-19 09:33:34 +01:00
parent 094b11cbcb
commit af6a43fa49

View File

@@ -18,6 +18,11 @@ podman rm -a -f &>/dev/null
t GET "libpod/containers/json (at start: clean slate)" 200 length=0 t GET "libpod/containers/json (at start: clean slate)" 200 length=0
# Regression test for #12904
podman run --rm -d --replace --name foo $IMAGE sh -c "echo 123;sleep 42"
t POST "containers/foo/attach?logs=true&stream=false" 200
t POST "containers/foo/kill" 204
podman run -v /tmp:/tmp $IMAGE true podman run -v /tmp:/tmp $IMAGE true
t GET libpod/containers/json 200 length=0 t GET libpod/containers/json 200 length=0