summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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