summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-06-23 06:06:48 -0600
committerValentin Rothberg <rothberg@redhat.com>2020-08-11 15:10:51 +0200
commit3f2cab86433859a1facf1996ad68dac23c9899b9 (patch)
tree394020b1a48f76cd283e450d6952cf08a4f53dde /test/system
parentca00601b14f2253e5b9f89280d39c5d498efc9f3 (diff)
downloadpodman-3f2cab86433859a1facf1996ad68dac23c9899b9.tar.gz
podman-3f2cab86433859a1facf1996ad68dac23c9899b9.tar.bz2
podman-3f2cab86433859a1facf1996ad68dac23c9899b9.zip
system tests: invoke with abs path to podman
Reversion of one part of #6679: my handling of 'realpath' would not work when $PODMAN is 'podman-remote --url etc'. Trying to handle that case got unmaintainable; so instead let's just force 'make {local,remote}system' to invoke with a full PODMAN path. This breaks down if someone runs the tests with a manual 'bats' invocation, but I think I'm the only one who ever does that. Since podman path will now be very long in the logs, add code to logformatter to abbreviate it like we do for the ginkgo logs. And, one thing that has bugged me for a long time: in the error logs, show a different prompt ('#' vs '$') to distinguish root vs rootless. This should make it much easier to see at-a-glance whether a log file is root or not. Add tests for it. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system')
-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 78326e6b7..0975effe7 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -16,6 +16,12 @@ IMAGE=$PODMAN_TEST_IMAGE_FQN
# Default timeout for a podman command.
PODMAN_TIMEOUT=${PODMAN_TIMEOUT:-60}
+# Prompt to display when logging podman commands; distinguish root/rootless
+_LOG_PROMPT='$'
+if [ $(id -u) -eq 0 ]; then
+ _LOG_PROMPT='#'
+fi
+
###############################################################################
# BEGIN setup/teardown tools
@@ -132,7 +138,7 @@ function run_podman() {
esac
# stdout is only emitted upon error; this echo is to help a debugger
- echo "\$ $PODMAN $*"
+ echo "$_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 "$@" 3>/dev/null