summaryrefslogtreecommitdiff
path: root/common/scripts/ltpfixup.sh
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2014-09-17 13:35:10 -0700
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-10-22 13:03:01 +0000
commit37c624ef3c4319b7c6d0269b56e944302462c228 (patch)
treeb667a77c4f6d1438e4f47a9cd169360c9519d8ce /common/scripts/ltpfixup.sh
parente4c93366e5d74b59633ccd038f84f06f07af8d00 (diff)
LTP skipfile: adding LTP skipfile
skipfile is a list of LTP test cases to be skipped from LTP full execution. The details about reason for skipping is also been described in skipfile. Change-Id: I8bb40a2b1e52b52125af5f0d8205f8c1a87067c0 Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Diffstat (limited to 'common/scripts/ltpfixup.sh')
-rwxr-xr-xcommon/scripts/ltpfixup.sh29
1 files changed, 19 insertions, 10 deletions
diff --git a/common/scripts/ltpfixup.sh b/common/scripts/ltpfixup.sh
index b0c0ca5..2d45877 100755
--- a/common/scripts/ltpfixup.sh
+++ b/common/scripts/ltpfixup.sh
@@ -5,26 +5,35 @@ SCRIPT=$(readlink -f $0)
# Absolute path this script is in. /home/user/bin
SCRIPTPATH=`dirname $SCRIPT`
echo "Script path is: $SCRIPTPATH"
+# List of test cases
+TST_CMDFILES=""
+# List of test cases to be skipped
+SKIPFILE=""
LTP_PATH=/opt/ltp
-# Second parameter is used as a path to LTP installation
-if [ "$#" -gt 1 ]; then
- LTP_PATH=$2
-fi
+
+while getopts T:S:P: arg
+ do case $arg in
+ T) TST_CMDFILES="$OPTARG";;
+ S) SKIPFILE="-S $SCRIPTPATH/ltp/$OPTARG";;
+ P) LTP_PATH=$OPTARG;;
+ esac
+done
+
cd $LTP_PATH
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`"
+error_statuses="`((./runltp -p -q -f $TST_CMDFILES -l $SCRIPTPATH/LTP_$TST_CMDFILES.log -C $SCRIPTPATH/LTP_$TST_CMDFILES.failed $SKIPFILE || echo "0:$?" >&3) |
+ (tee $SCRIPTPATH/LTP_$TST_CMDFILES.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-attach LTP_$1 $SCRIPTPATH/LTP_$1.tar.gz
+lava-test-case LTP_$TST_CMDFILES --result $RESULT
+find $SCRIPTPATH -name "LTP_$TST_CMDFILES.log" -print0 |xargs -0 cat
+tar czfv $SCRIPTPATH/LTP_$TST_CMDFILES.tar.gz $SCRIPTPATH/LTP*
+lava-test-case-attach LTP_$TST_CMDFILES $SCRIPTPATH/LTP_$TST_CMDFILES.tar.gz
exit 0