test_cli.sh: Return beakerlib's exit code
Read the return status directly from beakerlib's TestResults file. This is more robust when running the same test multiple times.
This commit is contained in:
parent
4bd03cb8f6
commit
a4dcc34396
@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# setup
|
export BEAKERLIB_DIR=$(mktemp -d /tmp/composer-test.XXXXXX)
|
||||||
rm -rf /var/tmp/beakerlib-*/
|
|
||||||
|
|
||||||
function setup_tests {
|
function setup_tests {
|
||||||
local share_dir=$1
|
local share_dir=$1
|
||||||
@ -103,8 +102,11 @@ else
|
|||||||
systemctl start lorax-composer
|
systemctl start lorax-composer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# look for failures
|
. $BEAKERLIB_DIR/TestResults
|
||||||
grep RESULT_STRING /var/tmp/beakerlib-*/TestResults | grep -v PASS && exit 1
|
|
||||||
|
|
||||||
# explicit return code for Makefile
|
if [ $TESTRESULT_RESULT_ECODE != 0 ]; then
|
||||||
exit 0
|
echo "Test failed. Leaving log in $BEAKERLIB_DIR"
|
||||||
|
exit $TESTRESULT_RESULT_ECODE
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf $BEAKERLIB_DIR
|
||||||
|
Loading…
Reference in New Issue
Block a user