summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2014-12-11 12:32:43 +0530
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2014-12-15 18:09:09 +0000
commitfa7808b12e4c89f30e0b4c7b935b956da48e2fb1 (patch)
tree0228ed5a966ac7cdc14c86e59b2747e4bc25fd9c /common
parent66a9c0175747f6b172b977a6e8cd9edece623c38 (diff)
dt-selftests: Adding Device Tree Runtime self tests
Adding Device Tree Runtime self tests CONFIG_OF_SELFTEST=y or new version of it CONFIG_OF_UNITTEST=y kernel config required for this tests. Change-Id: Ifdbed87ebe740041252cc751b6bc9ba73b2fa29d Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Diffstat (limited to 'common')
-rw-r--r--common/dt-selftests.yaml34
-rwxr-xr-xcommon/scripts/dt-selftests.awk13
-rwxr-xr-xcommon/scripts/dt-selftests.sh12
3 files changed, 59 insertions, 0 deletions
diff --git a/common/dt-selftests.yaml b/common/dt-selftests.yaml
new file mode 100644
index 0000000..bfeb854
--- /dev/null
+++ b/common/dt-selftests.yaml
@@ -0,0 +1,34 @@
+metadata:
+ name: dt-selftests
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Device Tree Runtime self tests
+ kernel config required for this tests
+ CONFIG_OF_SELFTEST=y or CONFIG_OF_UNITTEST=y"
+ maintainer:
+ - naresh.kamboju@linaro.org
+ os:
+ - ubuntu
+ - openembedded
+ scope:
+ - functional
+ devices:
+ - panda-es
+ - arndale-octa
+ - arndale
+ - snowball
+ - cubieboard3
+ - beagle-xm
+ - beaglebone-black
+ - imx6q-wandboard
+ - ifc6540
+ environment:
+ - lava-test-shell
+
+run:
+ steps:
+ - "./common/scripts/dt-selftests.sh"
+parse:
+ pattern: "^test_case_id:(?P<test_case_id>.*-*.+) measurement:(?P<measurement>.+) result:(?P<result>\\w+)"
+ fixupdict:
+ passed: pass
+ failed: fail
diff --git a/common/scripts/dt-selftests.awk b/common/scripts/dt-selftests.awk
new file mode 100755
index 0000000..a33eaf2
--- /dev/null
+++ b/common/scripts/dt-selftests.awk
@@ -0,0 +1,13 @@
+#!/usr/bin/awk
+started && /### dt-test ### end of selftest/ {
+ sub(/,/, "", $11)
+ printf "DT-SELFTEST %s: %s\n", $11, $10
+ printf "DT-SELFTEST %s: %s\n", $13, $12
+ print "dt-selftest end"
+ exit
+}
+
+!started && /### dt-test ### start of selftest/ {
+ print "dt-selftest start"
+ started = 1
+}
diff --git a/common/scripts/dt-selftests.sh b/common/scripts/dt-selftests.sh
new file mode 100755
index 0000000..1c77099
--- /dev/null
+++ b/common/scripts/dt-selftests.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+cd common/scripts
+dmesg | awk -f dt-selftests.awk > dt-selftest-stdout.log
+NO_OF_PASS=`grep "DT-SELFTEST passed" dt-selftest-stdout.log | awk '{print $3}'`
+NO_OF_FAIL=`grep "DT-SELFTEST failed" dt-selftest-stdout.log | awk '{print $3}'`
+if [ $NO_OF_FAIL -ne 0 ] ; then
+ echo "test_case_id:dt-selftest-passed measurement:$NO_OF_PASS result:passed"
+ echo "test_case_id:dt-selftest-failed measurement:$NO_OF_FAIL result:failed"
+else
+ echo "test_case_id:dt-selftest-passed measurement:$NO_OF_PASS result:passed"
+ echo "test_case_id:dt-selftest-failed measurement:$NO_OF_FAIL result:passed"
+fi