summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoresla <timothy.anzaku@linaro.org>2015-06-10 10:41:33 +0900
committeresla <timothy.anzaku@linaro.org>2015-06-10 23:39:40 +0900
commit237e706906d7b008293f0a6b15b49146c9961527 (patch)
treeb641b4e20af25954de6083926ec7b73f588a519e
parent0827dfbf9cc8e6ce19bf5fd6981f649e2e0cf897 (diff)
downloadtest-definitions-pipe-237e706906d7b008293f0a6b15b49146c9961527.tar.gz
Add support for LTP-DDT tests to existing ltp.yaml
Change-Id: If7696fed60bd2743cd7953b4cbbe6c4fc5c3aa76
-rwxr-xr-xcommon/scripts/ltpfixup.sh20
-rw-r--r--openembedded/ltp.yaml4
2 files changed, 16 insertions, 8 deletions
diff --git a/common/scripts/ltpfixup.sh b/common/scripts/ltpfixup.sh
index fe26774..777f237 100755
--- a/common/scripts/ltpfixup.sh
+++ b/common/scripts/ltpfixup.sh
@@ -9,12 +9,17 @@ echo "Script path is: $SCRIPTPATH"
TST_CMDFILES=""
# List of test cases to be skipped
SKIPFILE=""
+# Used only for ltp-ddt tests. Only run test cases which match PATTERNS. Patterns are
+# seperated by a comma
+PATTERNS=""
LTP_PATH=/opt/ltp
-while getopts T:S:P: arg
+while getopts T:S:P:s: arg
do case $arg in
- T) TST_CMDFILES="$OPTARG";;
+ T)
+ TST_CMDFILES="$OPTARG"
+ LOG_FILE=`echo $OPTARG| sed 's,\/,_,'`;;
S) OPT=`echo $OPTARG | grep "http"`
if [ -z $OPT ] ; then
SKIPFILE="-S $SCRIPTPATH/ltp/$OPTARG"
@@ -25,6 +30,7 @@ while getopts T:S:P: arg
fi
;;
P) LTP_PATH=$OPTARG;;
+ s) PATTERNS="-s $OPTARG";;
esac
done
@@ -32,16 +38,16 @@ cd $LTP_PATH
RESULT=pass
exec 4>&1
-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`"
+error_statuses="`((./runltp -p -q -f $TST_CMDFILES -l $SCRIPTPATH/LTP_$LOG_FILE.log -C $SCRIPTPATH/LTP_$LOG_FILE.failed $SKIPFILE $PATTERNS || echo "0:$?" >&3) |
+ (tee $SCRIPTPATH/LTP_$LOG_FILE.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_$TST_CMDFILES --result $RESULT
+lava-test-case LTP_$LOG_FILE --result $RESULT
cat $SCRIPTPATH/LTP_*.log
-tar czfv $SCRIPTPATH/LTP_$TST_CMDFILES.tar.gz $SCRIPTPATH/LTP*
-lava-test-case-attach LTP_$TST_CMDFILES $SCRIPTPATH/LTP_$TST_CMDFILES.tar.gz
+tar czfv $SCRIPTPATH/LTP_$LOG_FILE.tar.gz $SCRIPTPATH/LTP*
+lava-test-case-attach LTP_$LOG_FILE $SCRIPTPATH/LTP_$LOG_FILE.tar.gz
exit 0
diff --git a/openembedded/ltp.yaml b/openembedded/ltp.yaml
index 69c7de3..fc3914e 100644
--- a/openembedded/ltp.yaml
+++ b/openembedded/ltp.yaml
@@ -23,12 +23,14 @@ params:
# "skipfile-lsk-juno" is a known file present in dir ../common/scripts/ltp/
# or
# SKIPFILE: "http://people.linaro.org/~naresh.kamboju/skipfile"
+ # PATTERNS is used only for LTP-DDT tests
# NOTE: busybox wget may not work with https link so pefer to use http
SKIPFILE: ""
+ PATTERNS: ""
run:
steps:
- - './common/scripts/ltpfixup.sh -T $TST_CMDFILES -S $SKIPFILE'
+ - './common/scripts/ltpfixup.sh -T $TST_CMDFILES -S $SKIPFILE $PATTERNS'
parse:
pattern: "^(?!.+ED)(?P<test_case_id>\\w+)\\s+(?P<result>\\w+)\\s+\\d$"