From a4c24719445777292193fa2c7a325a1757096fdd Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 12 Nov 2020 05:55:39 -0700 Subject: system tests: various - images: confirm that 'podman images' emits headings even if there are no images present. Intended to replace e2e test which is difficult to get working under podman-remote. - build: add test for #8092, podman-build gobbling stdin. Workaround needed for issues #8342 and #8343, in which podman-remote output differs from podman local. - volumes: add test for #8307, double-lock on same volume. Signed-off-by: Ed Santiago --- test/system/010-images.bats | 12 ++++++++-- test/system/070-build.bats | 57 ++++++++++++++++++++++++++++++++++++++++++++ test/system/160-volumes.bats | 3 ++- 3 files changed, 69 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/system/010-images.bats b/test/system/010-images.bats index 900a24368..98bb0cc57 100644 --- a/test/system/010-images.bats +++ b/test/system/010-images.bats @@ -3,10 +3,18 @@ load helpers @test "podman images - basic output" { - run_podman images -a + headings="REPOSITORY *TAG *IMAGE ID *CREATED *SIZE" - is "${lines[0]}" "REPOSITORY *TAG *IMAGE ID *CREATED *SIZE" "header line" + run_podman images -a + is "${lines[0]}" "$headings" "header line" is "${lines[1]}" "$PODMAN_TEST_IMAGE_REGISTRY/$PODMAN_TEST_IMAGE_USER/$PODMAN_TEST_IMAGE_NAME *$PODMAN_TEST_IMAGE_TAG *[0-9a-f]\+" "podman images output" + + # 'podman images' should emit headings even if there are no images + # (but --root only works locally) + if ! is_remote; then + run_podman --root ${PODMAN_TMPDIR}/nothing-here-move-along images + is "$output" "$headings" "'podman images' emits headings even w/o images" + fi } @test "podman images - custom formats" { diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 064cad965..83bcd13eb 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -318,6 +318,63 @@ EOF run_podman rmi -f build_test } +# #8092 - podman build should not gobble stdin (Fixes: #8066) +@test "podman build - does not gobble stdin that does not belong to it" { + random1=random1-$(random_string 12) + random2=random2-$(random_string 15) + random3=random3-$(random_string 12) + + tmpdir=$PODMAN_TMPDIR/build-test + mkdir -p $tmpdir + cat >$tmpdir/Containerfile </myvol/myfile" run_podman volume ls -q is "$output" "$myvol" "autocreated named container persists" -- cgit v1.2.3-54-g00ecf