Files
bootrr/helpers/bootrr
Nicolas Dechesne 8db9a55c02 bootrr: emulate lava-test-case command
In case lava-test-command is not available, emulate what it is
supposed to do. This is a convenient hack to make it easier to run
bootrr locally for debug/testing purpose.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
2018-06-18 12:33:27 -07:00

27 lines
388 B
Bash

#!/bin/sh
timeout() {
attempts="$1"; shift
cmd="$@"
for i in `seq ${attempts}`
do
$cmd && return 0
sleep 1
done
return 1
}
test_report_exit() {
TEST_RESULT=$1
command -v lava-test-case
if [ "$?" -eq 0 ]; then
lava-test-case ${TEST_CASE_ID} --result ${TEST_RESULT}
else
echo "<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=${TEST_CASE_ID} RESULT=${TEST_RESULT}>"
fi
exit 0
}