summaryrefslogtreecommitdiff
path: root/test/system/helpers.bash
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-15 23:33:02 +0100
committerGitHub <noreply@github.com>2020-01-15 23:33:02 +0100
commit0870e88ff48eaf6b5624044b7cd2bc35cff85150 (patch)
treee0cd9d15cda69ffa8818cb84a5554ee48f41ca29 /test/system/helpers.bash
parent978b891c8d2ffa7d52d872625a9ce3816c90334c (diff)
parent1298f19773574963b9ce5ba7ca3b1637d1a07ef6 (diff)
downloadpodman-0870e88ff48eaf6b5624044b7cd2bc35cff85150.tar.gz
podman-0870e88ff48eaf6b5624044b7cd2bc35cff85150.tar.bz2
podman-0870e88ff48eaf6b5624044b7cd2bc35cff85150.zip
Merge pull request #4824 from edsantiago/bats
more BATS tests
Diffstat (limited to 'test/system/helpers.bash')
-rw-r--r--test/system/helpers.bash14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/system/helpers.bash b/test/system/helpers.bash
index 940f3f426..2e856930e 100644
--- a/test/system/helpers.bash
+++ b/test/system/helpers.bash
@@ -192,15 +192,24 @@ function wait_for_output {
fi
done
- [ -n "$cid" ] || die "FATAL: wait_for_ready: no container name/ID in '$*'"
+ [ -n "$cid" ] || die "FATAL: wait_for_output: no container name/ID in '$*'"
t1=$(expr $SECONDS + $how_long)
while [ $SECONDS -lt $t1 ]; do
run_podman logs $cid
- if expr "$output" : ".*$expect" >/dev/null; then
+ logs=$output
+ if expr "$logs" : ".*$expect" >/dev/null; then
return
fi
+ # Barf if container is not running
+ run_podman inspect --format '{{.State.Running}}' $cid
+ if [ $output != "true" ]; then
+ run_podman inspect --format '{{.State.ExitCode}}' $cid
+ exitcode=$output
+ die "Container exited (status: $exitcode) before we saw '$expect': $logs"
+ fi
+
sleep $sleep_delay
done
@@ -258,6 +267,7 @@ function skip_if_not_systemd() {
# die # Abort with helpful message
#########
function die() {
+ # FIXME: handle multi-line output
echo "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv" >&2
echo "#| FAIL: $*" >&2
echo "#\\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" >&2