summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMingli Yu <Mingli.Yu@windriver.com>2018-11-22 22:58:49 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-08 20:14:42 +0000
commitcc4ce7db1993e9ec1857e9081c7b0046321ddcbe (patch)
tree06545dede310001a2eb262cde9189832dac070a4 /meta
parentf48d96e4dfaf917dc99f8aa8830845e1e13794b7 (diff)
downloadpoky-cc4ce7db1993e9ec1857e9081c7b0046321ddcbe.tar.gz
mdadm: improve the run-ptest
* There are 120+ cases under ${libdir}/mdadm/ptest/tests, but the test will break if one test fails as below logic in run-ptest. ./test &>./test.log That's to say, the tests after the failed test have no chance to run with the current logic. To guarantee all the tests can run even one of the tests fails, the option --keep-going should be added. * Refactor the test report to make the report more detailed and more common (From OE-Core rev: 80d17497b719efb2ca9f36b8a730815547e93aa7) (From OE-Core rev: 1b84064b15022a0834d7f443a8d6bde7f4cfeb6d) Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/mdadm/files/run-ptest25
1 files changed, 17 insertions, 8 deletions
diff --git a/meta/recipes-extended/mdadm/files/run-ptest b/meta/recipes-extended/mdadm/files/run-ptest
index 5b276090f5..234f97376a 100644
--- a/meta/recipes-extended/mdadm/files/run-ptest
+++ b/meta/recipes-extended/mdadm/files/run-ptest
@@ -1,10 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2 2
3./test &>./test.log 3LOG="$(pwd)/test.log"
4if [ $? -eq 0 ] 4# make the test continue to execute even one fail
5then 5./test --keep-going 2>&1|tee ${LOG}
6 echo "PASS: mdadm" 6# translate the test report
7 rm test.log 7# "tests/18imsm-r10_4d-takeover-r0_2d... succeeded" -> "PASS: tests/18imsm-r10_4d-takeover-r0_2d"
8else 8# "tests/19raid6repair... FAILED - see //log for details" -> "FAIL: tests/19raid6repair"
9 echo "FAIL: mdadm" 9sed -i -e '/succeeded/ s/^/PASS: /' -e '/FAILED/ s/^/FAIL: /' ${LOG}
10fi 10sed -i -e 's/... FAILED//g' -e 's/... succeeded//g' ${LOG}
11passed=`grep PASS: ${LOG}|wc -l`
12failed=`grep FAIL: ${LOG}|wc -l`
13all=$((passed + failed))
14
15( echo "=== Test Summary ==="
16 echo "TOTAL: ${all}"
17 echo "PASSED: ${passed}"
18 echo "FAILED: ${failed}"
19) | tee -a /${LOG}