From 187e3486be9e6fbc9d0464c442a41a2e4cd9c752 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 17 Jul 2024 18:22:53 -0700 Subject: [PATCH] podman bats: tee the output to a log file and upload it ...this makes it much easier to see what's failing if it fails. Signed-off-by: Adam Williamson --- lib/installedtest.pm | 4 ++++ tests/podman.pm | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 1b7b2200..f4f165a3 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -159,6 +159,10 @@ sub post_fail_hook { upload_logs "/var/tmp/imgbuild/program.log", failok => 1; } + if (get_var("TEST") eq "podman") { + upload_logs "/tmp/podman-bats.txt", failok => 1; + } + if (get_var("ADVISORY_OR_TASK") && get_var("TEST") ne "install_default_update_netinst") { unless (get_var("TEST") eq "support_server" && get_var("VERSION") ne get_var("CURRREL")) { # For update tests, let's do the update package info log stuff, diff --git a/tests/podman.pm b/tests/podman.pm index 10b0dc35..c6a2314c 100644 --- a/tests/podman.pm +++ b/tests/podman.pm @@ -17,7 +17,11 @@ sub run { unless (get_var("CANNED")) { # run the upstream integration tests assert_script_run "dnf -y install podman podman-tests bats", 300; - assert_script_run "bats --filter-tags distro-integration /usr/share/podman/test/system", 600; + # needed so we exit 1 when the bats command fails + assert_script_run "set -o pipefail"; + assert_script_run "bats --filter-tags distro-integration /usr/share/podman/test/system | tee /tmp/podman-bats.txt", 600; + # restore default behaviour + assert_script_run "set +o pipefail"; } # check to see if you can pull an image from the registry assert_script_run "podman pull registry.fedoraproject.org/fedora:latest", 300;