diff options
author | Chase Qi <chase.qi@linaro.org> | 2015-01-12 15:15:25 +0800 |
---|---|---|
committer | Chase Qi <chase.qi@linaro.org> | 2015-01-12 15:15:25 +0800 |
commit | 4803e56ed30d4824f4142d4ed616f06d10263f8e (patch) | |
tree | 552ee9171df163da1c401cd9efb677be7eb3ccc7 | |
parent | 6619636f2e7667f3a849a1a8a7f002061c105379 (diff) |
ubuntu: add ltp test
-rwxr-xr-x | common/scripts/ltpfixup.sh | 39 | ||||
-rw-r--r-- | ubuntu/ltp.yaml | 47 |
2 files changed, 86 insertions, 0 deletions
diff --git a/common/scripts/ltpfixup.sh b/common/scripts/ltpfixup.sh new file mode 100755 index 0000000..2d45877 --- /dev/null +++ b/common/scripts/ltpfixup.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# Absolute path to this script. /home/user/bin/foo.sh +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 + +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 $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_$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 diff --git a/ubuntu/ltp.yaml b/ubuntu/ltp.yaml new file mode 100644 index 0000000..df35235 --- /dev/null +++ b/ubuntu/ltp.yaml @@ -0,0 +1,47 @@ +metadata: + name: ltp + format: "Lava-Test-Shell Test Definition 1.0" + description: "Run LTP test suite on Ubuntu" + maintainer: + - milosz.wasilewski@linaro.org + - fathi.boudra@linaro.org + os: + - ubuntu + scope: + - functional + devices: + - panda + - panda-es + - arndale + - vexpress-a9 + - vexpress-tc2 + - ifc6410 + +install: + steps: + - 'git clone https://github.com/linux-test-project/ltp.git' + - 'cd ltp' + - 'mkdir build' + - './configure --prefix=$(readlink -f build)' + - 'make all' + - 'make SKIP_IDCHECK=1 install' + deps: + - bzip2 + - flex + - bison + - build-essential + - wget + +params: + TST_CMDFILES: syscalls,mm,math,timers,fcntl-locktests,ipc,fsx,fs,hugetlb,io,nptl,pty,containers,fs_bind,filecaps,admin_tools,connectors + SKIPFILE: "" + +run: + steps: + - './common/scripts/ltpfixup.sh -T $TST_CMDFILES -P $(readlink -f build) -S $SKIPFILE' + +parse: + pattern: "^(?!.+ED)(?P<test_case_id>\\w+)\\s+(?P<result>\\w+)\\s+\\d$" + fixupdict: + FAIL: fail + PASS: pass |