summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcommon/scripts/ltp-ddt.sh85
-rw-r--r--ubuntu/ltp-ddt.yaml37
2 files changed, 122 insertions, 0 deletions
diff --git a/common/scripts/ltp-ddt.sh b/common/scripts/ltp-ddt.sh
new file mode 100755
index 0000000..8f24675
--- /dev/null
+++ b/common/scripts/ltp-ddt.sh
@@ -0,0 +1,85 @@
+#! /bin/bash
+#
+# LTP-DDT Test wrapper
+#
+# Copyright (C) 2015, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+#
+
+usage()
+{
+ cat <<-EOF >&2
+
+ usage: ./${0##*/} [-p LTP_PATH] [-f CMD_FILES(,...)] [-s PATTERNS(,...)]
+ -f CMDFILES Execute user defined list of testcases (separate with ',')
+ -h Help. Prints all available options.
+ -p LTP_PATH Default path for ltp-ddt. Default path is /opt/ltp
+ -P PLATFORM Platform to run tests on. Used to filter device driver tests (ddt)
+ -s PATTERNS Only run test cases which match PATTERNS. Patterns seperated by ','
+
+ example: ./${0##*/} -p /home/test/ltp -f ddt/memtest -s IN_ALL_BANK,OUT_ALL_BANK
+
+EOF
+exit 0
+}
+
+main()
+{
+ # 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"
+
+ CMD_FILES=""
+ PATTERNS=""
+ PATTERNS_OPTION=""
+ PLATFORM=""
+ #default path for ltp-ddt
+ LTP_PATH="/opt/ltp"
+ LOG_FILE="default"
+
+ while getopts p:f:s:P:h arg
+ do
+ case $arg in
+ p) LTP_PATH="$OPTARG";;
+ P) PLATFORM="-P $OPTARG";;
+ f)
+ CMD_FILES="$OPTARG"
+ LOG_FILE=`echo $OPTARG| sed 's,\/,_,'`;;
+ s) PATTERNS="-s $OPTARG";;
+ h) usage;;
+ esac
+ echo $arg
+ done
+ if [ -z "$CMD_FILES" ]; then
+ echo "WARNING: Will run all ltp-ddt testcases or all those that match PATTERNS"
+ fi
+
+ if [ -n "$PATTERNS" ]; then
+ PATTERNS_OPTION="-s $PATTERNS"
+ fi
+
+ ## Second parameter is used as a path to LTP installation
+ cd $LTP_PATH
+ ./runltp -p -q -f ${CMD_FILES} $PLATFORM $PATTERNS -l $SCRIPTPATH/LTP_${LOG_FILE}.log \
+ -C $SCRIPTPATH/LTP_${LOG_FILE}.failed | tee $SCRIPTPATH/LTP_${LOG_FILE}.out
+ tar -czvf $SCRIPTPATH/LTP_${LOG_FILE}.tar.gz $SCRIPTPATH/LTP*
+ lava-test-case-attach LTP_$1 $SCRIPTPATH/LTP_${LOG_FILE}.tar.gz
+ exit 0
+}
+main "$@"
diff --git a/ubuntu/ltp-ddt.yaml b/ubuntu/ltp-ddt.yaml
new file mode 100644
index 0000000..d9703f8
--- /dev/null
+++ b/ubuntu/ltp-ddt.yaml
@@ -0,0 +1,37 @@
+metadata:
+ name: ltp_ddt
+ format: "Lava-Test-Shell Test Definition 1.0"
+ version: 20151112
+ description: "Run LTP-DDT test suite on Debian."
+ maintainer:
+ - milosz.wasilewski@linaro.org
+ - timothy.anzaku@linaro.org
+ os:
+ - debian
+ scope:
+ - functional
+ devices:
+ - dragonboard410c
+ - hikey
+
+params:
+ TST_CMDFILES: ddt/memtest
+ PLATFORM: hikey
+ PATTERNS: MEMORY_M_FUNC_MEMTESTER_10pct_1time
+
+run:
+ steps:
+ - './common/scripts/ltp-ddt.sh -f $TST_CMDFILES -P $PLATFORM -s $PATTERNS'
+
+parse:
+ pattern: "^(?!.+ED)(?P<test_case_id>\\w+)\\s+(?P<result>\\w+)\\s+\\d$"
+ fixupdict:
+ FAIL: fail
+ PASS: pass
+# To run LTP-DDT tests through this yaml script, it is assumed that
+# the ltp-ddt test has been pre-installed in the debian image.
+# More information about the ltp-ddt test suite can be found at
+# http://arago-project.org/git/projects/test-automation/ltp-ddt.git
+# WARNING: The test parameters for most usecases will defer from the default
+# TST_CMDFILES, PLATFORM, and PATTERNS. Please set appropriate parameters
+# in your test job.