rpm-ostree/tests/compose-tests/run-test.sh
Jonathan Lebon 391a684b5f tests/compose: Fix run-test.sh regression
Regression from hasty hack in #1488. We want to return nonzero if the
test failed so that `parallel` fails too.

Closes: #1491
Approved by: cgwalters
2018-08-07 16:00:13 +00:00

19 lines
439 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
tf=$1
export TEST_ARTIFACTS=${LOGDIR}/${tf}
mkdir -p ${TEST_ARTIFACTS}
# Redirect our stdout/stderr, since we don't want what GNU parallel does
exec 1>${TEST_ARTIFACTS}/output.txt
exec 2>&1
# Rename the dir itself if non-zero rc to make it easy to know what failed
rc=0
$(dirname $0)/${tf} || rc=$?
if [ $rc == 0 ]; then
mv ${TEST_ARTIFACTS}{,.pass}
else
mv ${TEST_ARTIFACTS}{,.fail.$rc}
fi
[ $rc == 0 ]