From aec58f515ef581329da806c093d281035f21791e Mon Sep 17 00:00:00 2001
From: Ed Santiago <santiago@redhat.com>
Date: Tue, 19 Sep 2023 06:39:57 -0600
Subject: [PATCH] systests: clean up after tests; fix missing path in logs

Followup to #20016:
- remove obsolete (misleading) comment
- prune dangling <none>:<none> image

Also, in kube test, rmi pause_image to avoid nasty red warnings

Also, ouch, fix a stupid that I introduced in #19878: the PODMAN
command path got dropped from log messages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
---
 test/system/012-manifest.bats | 5 ++++-
 test/system/710-kube.bats     | 1 +
 test/system/helpers.bash      | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/system/012-manifest.bats b/test/system/012-manifest.bats
index b800d0263b..1e672a9490 100644
--- a/test/system/012-manifest.bats
+++ b/test/system/012-manifest.bats
@@ -121,7 +121,7 @@ EOF
     local manifestlocal="test:1.0"
     run_podman manifest create $manifestlocal
     for arch in amd arm;do
-        # FIXME: --layers=false needed to work around #19860
+        # This leaves behind a <none>:<none> image that must be purged, below
         run_podman build -t image_$arch --platform linux/${arch}64 -f $dockerfile
         run_podman manifest add $manifestlocal containers-storage:localhost/image_$arch:latest
     done
@@ -145,6 +145,9 @@ EOF
 
     run_podman rmi image_amd image_arm
     run_podman manifest rm $manifestlocal
+
+    # Needed because the above build leaves a dangling <none>
+    run_podman image prune -f
 }
 
 # vim: filetype=sh
diff --git a/test/system/710-kube.bats b/test/system/710-kube.bats
index f5e7d31ca1..b178c2950f 100644
--- a/test/system/710-kube.bats
+++ b/test/system/710-kube.bats
@@ -87,6 +87,7 @@ status                           | =  | null
       run_podman kube down $KUBE
       run_podman pod rm -a
       run_podman rm -a
+      run_podman rmi $(pause_image)
 }
 
 @test "podman kube generate - pod" {
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index f8d1f8709e..d3e2dccc06 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -340,7 +340,7 @@ function run_podman() {
     MOST_RECENT_PODMAN_COMMAND="podman $*"
 
     # stdout is only emitted upon error; this printf is to help in debugging
-    printf "\n%s %s %s\n" "$(timestamp)" "$_LOG_PROMPT" "$*"
+    printf "\n%s %s %s %s\n" "$(timestamp)" "$_LOG_PROMPT" "$PODMAN" "$*"
     # BATS hangs if a subprocess remains and keeps FD 3 open; this happens
     # if podman crashes unexpectedly without cleaning up subprocesses.
     run timeout --foreground -v --kill=10 $PODMAN_TIMEOUT $PODMAN $_PODMAN_TEST_OPTS "$@" 3>/dev/null