[oe-commits] [openembedded-core] 23/92: mdadm: improve the run-ptest

git at git.openembedded.org git at git.openembedded.org
Tue Jan 8 20:19:41 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch thud
in repository openembedded-core.

commit 1b84064b15022a0834d7f443a8d6bde7f4cfeb6d
Author: Mingli Yu <Mingli.Yu at windriver.com>
AuthorDate: Thu Nov 22 22:58:49 2018 -0800

    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)
    
    Signed-off-by: Mingli Yu <Mingli.Yu at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/recipes-extended/mdadm/files/run-ptest | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-extended/mdadm/files/run-ptest b/meta/recipes-extended/mdadm/files/run-ptest
index 5b27609..234f973 100644
--- a/meta/recipes-extended/mdadm/files/run-ptest
+++ b/meta/recipes-extended/mdadm/files/run-ptest
@@ -1,10 +1,19 @@
 #!/bin/sh
 
-./test &>./test.log
-if [ $? -eq 0 ]
-then
-	echo "PASS: mdadm"
-	rm test.log
-else
-	echo "FAIL: mdadm"
-fi
+LOG="$(pwd)/test.log"
+# make the test continue to execute even one fail
+./test --keep-going 2>&1|tee ${LOG}
+# translate the test report
+# "tests/18imsm-r10_4d-takeover-r0_2d... succeeded" -> "PASS: tests/18imsm-r10_4d-takeover-r0_2d"
+# "tests/19raid6repair... FAILED - see //log for details" -> "FAIL: tests/19raid6repair"
+sed -i -e '/succeeded/ s/^/PASS: /' -e '/FAILED/ s/^/FAIL: /' ${LOG}
+sed -i -e 's/... FAILED//g' -e 's/... succeeded//g' ${LOG}
+passed=`grep PASS: ${LOG}|wc -l`
+failed=`grep FAIL: ${LOG}|wc -l`
+all=$((passed + failed))
+
+( echo "=== Test Summary ==="
+  echo "TOTAL: ${all}"
+  echo "PASSED: ${passed}"
+  echo "FAILED: ${failed}"
+) | tee -a /${LOG}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list