summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-29 14:37:42 +0000
committerGitHub <noreply@github.com>2021-03-29 14:37:42 +0000
commit5e156c892c248b38005709e1e20838aeceface19 (patch)
treee59453739aa1aaf13636a55d8d5c3298e107ba9a /test
parent236943d3c1fde6f4a2fec15205c1d59be6264d12 (diff)
parent06ae12bd4ef9447dae69827b1c11fbf40d1615bc (diff)
downloadpodman-5e156c892c248b38005709e1e20838aeceface19.tar.gz
podman-5e156c892c248b38005709e1e20838aeceface19.tar.bz2
podman-5e156c892c248b38005709e1e20838aeceface19.zip
Merge pull request #9857 from edsantiago/bats
system tests: friendier messages for 2-arg is()
Diffstat (limited to 'test')
-rw-r--r--test/system/helpers.bash8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 38e317709..823dc3376 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -72,6 +72,9 @@ function basic_setup() {
# on cleanup.
# TODO: do this outside of setup, so it carries across tests?
PODMAN_TMPDIR=$(mktemp -d --tmpdir=${BATS_TMPDIR:-/tmp} podman_bats.XXXXXX)
+
+ # In the unlikely event that a test runs is() before a run_podman()
+ MOST_RECENT_PODMAN_COMMAND=
}
# Basic teardown: remove all pods and containers
@@ -150,6 +153,9 @@ function run_podman() {
'?') expected_rc= ; shift;; # ignore exit code
esac
+ # Remember command args, for possible use in later diagnostic messages
+ MOST_RECENT_PODMAN_COMMAND="podman $*"
+
# stdout is only emitted upon error; this echo is to help a debugger
echo "$_LOG_PROMPT $PODMAN $*"
# BATS hangs if a subprocess remains and keeps FD 3 open; this happens
@@ -384,7 +390,7 @@ function die() {
function is() {
local actual="$1"
local expect="$2"
- local testname="${3:-FIXME}"
+ local testname="${3:-${MOST_RECENT_PODMAN_COMMAND:-[no test name given]}}"
if [ -z "$expect" ]; then
if [ -z "$actual" ]; then