summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2016-05-03 16:41:44 +0530
committerNaresh Kamboju <naresh.kamboju@linaro.org>2016-05-03 16:44:25 +0530
commit29166a45638e30fc1bc09766c1fbc1cefe406ef6 (patch)
treebd458ab2fd0e613b490a3c2513c7b7b01f69ef10
parentc00c6d087117852c613699f2766204315d361297 (diff)
kselftests: fix path and run steps
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
-rw-r--r--ubuntu/kselftests-static.yaml5
-rw-r--r--ubuntu/scripts/test_kselftest.sh51
2 files changed, 52 insertions, 4 deletions
diff --git a/ubuntu/kselftests-static.yaml b/ubuntu/kselftests-static.yaml
index b08f8f6..3e55960 100644
--- a/ubuntu/kselftests-static.yaml
+++ b/ubuntu/kselftests-static.yaml
@@ -23,10 +23,7 @@ install:
run:
steps:
- - "cd ubuntu/scripts; ./run_kselftest.sh"
- - 'cd /usr/lib/kselftests/'
- - 'ls '
- - './run_kselftest.sh'
+ - "cd ubuntu/scripts; ./test_kselftest.sh $TESTPROG"
parse:
pattern: "^selftests:\\s(?P<test_case_id>\\S+)\\s[[](?P<result>(FAIL|PASS|SKIP))[]]"
diff --git a/ubuntu/scripts/test_kselftest.sh b/ubuntu/scripts/test_kselftest.sh
new file mode 100644
index 0000000..1f0e85e
--- /dev/null
+++ b/ubuntu/scripts/test_kselftest.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# Kselftest test cases from kernel tree
+#
+# Copyright (C) 2016, 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.
+#
+# Author: Naresh Kamboju <naresh.kamboju@linaro.org>
+
+TESTPROG=$1
+KSELFTEST_PATH=/usr/lib/kselftests
+
+# kselftests builts in rootfs
+get_kselftest() {
+ if [ -d $KSELFTEST_PATH ]; then
+ echo "kselftests found"
+ cd $KSELFTEST_PATH
+ else
+ echo "Downloading kselftests"
+ cd $KSELFTEST_PATH
+ wget http://testdata.validation.linaro.org/tests/kselftest/$TESTPROG -O kselftest.tar.gz
+ tar -xaf kselftest.tar.gz
+ cd kselftest
+ fi
+}
+
+run_kselftest() {
+# Avoid dmesg logs for results parsing
+# ./run_kselftest.sh > kselftest-output.log
+# cat kselftest-output.log
+# default case
+ ./run_kselftest.sh
+}
+
+# main
+get_kselftest
+run_kselftest
+exit 0