aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorKevin Hilman <khilman@baylibre.com>2018-11-26 16:02:24 -0800
committerKevin Hilman <khilman@baylibre.com>2018-11-26 16:47:51 -0800
commit435237023d1368d7d73085006f021f9307fde520 (patch)
treee7cc2c363688d17331be57ab1a9a41e8046fda30 /common
parent4f56ed2afbc39ada5978280801c41d7ce903bc9c (diff)
ptest wrapper: use new LAVA mode
ptest-runner now has a new LAVA mode (enabled with -L) that will automatically output the LAVA_SIGNAL messages needed for LAVA to automatically parse/collect test results. Re-work this wrapper script to that it just uses the new LAVA mode. Change-Id: I310f1188f65de5f86e8179c12aedce6a92932e9a Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Diffstat (limited to 'common')
-rwxr-xr-xcommon/scripts/ptest-lava-wrapper-all.sh26
-rwxr-xr-xcommon/scripts/ptest-lava-wrapper.sh21
2 files changed, 3 insertions, 44 deletions
diff --git a/common/scripts/ptest-lava-wrapper-all.sh b/common/scripts/ptest-lava-wrapper-all.sh
index 2d3bbdb..2aa3301 100755
--- a/common/scripts/ptest-lava-wrapper-all.sh
+++ b/common/scripts/ptest-lava-wrapper-all.sh
@@ -5,33 +5,9 @@ command -v ptest-runner >/dev/null 2>&1
if [ $? -ne 0 ] ; then
lava-test-case ptest-installed --result SKIP
else
- # Run ptests for specified packages
- lava-test-set start ptest-full
-
- UNIT_LOG=$(ptest-runner 2> results.log )
- if [ $? -eq 0 ] ; then
- # grep: Get only the ptests results, no log
- # sed 1: replace spaces by hyphens
- # sed 2: remove any special character
- # sed 3: find status and test name, wrap it in a lava-test-case call
- # sh: execute the lava-test-case commands
- test_pass=$(echo "$UNIT_LOG" | grep -e 'PASS' | wc -l)
- test_fail=$(echo "$UNIT_LOG" | grep -e 'FAIL' | wc -l)
- lava-test-case passed-commands --result PASS --measurement $test_pass --units pass
- if ! [ x"0" = x"$test_fail" ] ; then
- lava-test-case failed-commands --result FAIL --measurement $test_fail --units fail
- echo "$UNIT_LOG" | grep -e 'FAIL'
- fi
- else
- lava-test-case ptest-runner ptest-full --result fail
- fi
-
- lava-test-set stop ptest-full
-
+ ptest-runner -L
lava-test-case ptest-runtime --measurement $SECONDS --units seconds --result PASS
fi
# Wait for LAVA to parse all the tests from stdout
sleep 15
-
-cat results.log
diff --git a/common/scripts/ptest-lava-wrapper.sh b/common/scripts/ptest-lava-wrapper.sh
index 21635ce..8e6e879 100755
--- a/common/scripts/ptest-lava-wrapper.sh
+++ b/common/scripts/ptest-lava-wrapper.sh
@@ -12,26 +12,9 @@ if [ $? -ne 0 ] ; then
else
# Run ptests for specified packages
for unit in ${REQUIREDPTESTS}; do
- lava-test-set start ptest-$unit
- UNIT_LOG=$(ptest-runner ${unit} 2> /dev/null)
- if [ $? -eq 0 ] ; then
- # grep: Get only the ptests results, no log
- # sed 1: replace spaces by hyphens
- # sed 2: remove any special character
- # sed 3: find status and test name, wrap it in a lava-test-case call
- # sh: execute the lava-test-case commands
- test_pass=$(echo "$UNIT_LOG" | grep -e 'PASS' | wc -l)
- test_fail=$(echo "$UNIT_LOG" | grep -e 'FAIL' | wc -l)
- lava-test-case ${unit}-passed-commands --result PASS --measurement $test_pass --units pass
- if ! [ x"0" = x"$test_fail" ] ; then
- lava-test-case ${unit}-failed-commands --result FAIL --measurement $test_fail --units fail
- echo "$UNIT_LOG" | grep -e 'FAIL'
- fi
- lava-test-set stop ptest-$unit
- else
- lava-test-case ptest-runner-${unit} --result fail
- fi
+ ptest-runner -L ${unit}
done
+
lava-test-case ptest-runtime --measurement $SECONDS --units seconds --result PASS
fi