summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEsla <slacowr@gmail.com>2016-04-01 11:48:09 +0900
committerEsla <slacowr@gmail.com>2016-04-01 11:48:09 +0900
commit9a8ee58df8939cfcfd08aeb0324f9625a2b7d8ff (patch)
tree4b3d4b713501f1836efbbd89cb2123ff7091c846 /common
parent781e6b79c24c59759b8ab88b4311eaf019faf305 (diff)
Add support for the ltp-ddt testsuites for Ubuntu
Change-Id: I0d3c94e3dface54a586b303ddc358f5c31780e7b
Diffstat (limited to 'common')
-rwxr-xr-xcommon/scripts/ltp-ddt.sh85
1 files changed, 85 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 "$@"