[oe-commits] [openembedded-core] 04/05: mdadm: make ptest output format align with common style

git at git.openembedded.org git at git.openembedded.org
Tue Jul 16 12:54:16 UTC 2019


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

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

commit f9520d360faf58f18963ce61f4968bcd3ed1c3db
Author: Changqing Li <changqing.li at windriver.com>
AuthorDate: Tue Jul 16 11:48:42 2019 +0800

    mdadm: make ptest output format align with common style
    
    Signed-off-by: Changqing Li <changqing.li at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-extended/mdadm/files/run-ptest | 17 +----------------
 meta/recipes-extended/mdadm/mdadm_4.1.bb    |  8 ++++++++
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/meta/recipes-extended/mdadm/files/run-ptest b/meta/recipes-extended/mdadm/files/run-ptest
index 234f973..e4a9c2b 100644
--- a/meta/recipes-extended/mdadm/files/run-ptest
+++ b/meta/recipes-extended/mdadm/files/run-ptest
@@ -1,19 +1,4 @@
 #!/bin/sh
 
-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}
+./test --keep-going
diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb b/meta/recipes-extended/mdadm/mdadm_4.1.bb
index 5df3f90..0cd9626 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
@@ -74,6 +74,14 @@ do_install_ptest() {
 	cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests
 	cp ${S}/test ${D}${PTEST_PATH}
 	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
+        sed -i -e '/echo -ne "$_script... "/d' \
+               -e 's/echo "succeeded"/echo -e "PASS: $_script"/g' \
+               -e '/save_log fail/N; /_fail=1/i\\t\t\techo -ne "FAIL: $_script"' \
+               -e '/die "dmesg prints errors when testing $_basename!"/i\\t\t\t\techo -ne "FAIL: $_script" &&' \
+               ${D}${PTEST_PATH}/test
+
+        chmod +x ${D}${PTEST_PATH}/test
+
 	ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
 	for prg in test_stripe swap_super raid6check
 	do

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


More information about the Openembedded-commits mailing list