summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-08-15 13:43:52 +0100
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-08-15 13:43:52 +0100
commit4001fa8aa2c76af25250915b909042d49be147b1 (patch)
treedec4b18d3138091929667281b799e57b1e8ce37d /common
parent2b6f64202f831935339b6a237d2b768dcd833e69 (diff)
LTP: return 'fail' result in case anything goes wrong
ltpfixup.sh script was returning result 'pass' when there was no LTP tests available in rootfs. This problem is fixed now. As a side effect the LAVA test LTP_xxx will become 'failed' in case any of the LTP tests fails during execution (runltp return something else than 0). Change-Id: Ib9881741a6311afaac3c4346283a9a62b599fe69 Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'common')
-rwxr-xr-xcommon/scripts/ltpfixup.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/scripts/ltpfixup.sh b/common/scripts/ltpfixup.sh
index 3fec48f..b0c0ca5 100755
--- a/common/scripts/ltpfixup.sh
+++ b/common/scripts/ltpfixup.sh
@@ -12,9 +12,19 @@ if [ "$#" -gt 1 ]; then
LTP_PATH=$2
fi
cd $LTP_PATH
-./runltp -p -q -f $1 -l $SCRIPTPATH/LTP_$1.log -C $SCRIPTPATH/LTP_$1.failed | tee $SCRIPTPATH/LTP_$1.out
+RESULT=pass
+
+exec 4>&1
+error_statuses="`((./runltp -p -q -f $1 -l $SCRIPTPATH/LTP_$1.log -C $SCRIPTPATH/LTP_$1.failed || echo "0:$?" >&3) |
+ (tee $SCRIPTPATH/LTP_$1.out || echo "1:$?" >&3)) 3>&1 >&4`"
+exec 4>&-
+
+! echo "$error_statuses" | grep '0:' >/dev/null
+if [ $? -ne 0 ]; then
+ RESULT=fail
+fi
+lava-test-case LTP_$1 --result $RESULT
find $SCRIPTPATH -name "LTP_$1.log" -print0 |xargs -0 cat
tar czfv $SCRIPTPATH/LTP_$1.tar.gz $SCRIPTPATH/LTP*
-lava-test-case LTP_$1 --result pass
lava-test-case-attach LTP_$1 $SCRIPTPATH/LTP_$1.tar.gz
exit 0