summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/mdadm
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2019-07-16 11:48:42 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-17 09:36:35 +0100
commiteba6cd155a7ad02b736566727f58a3958048bfc8 (patch)
tree19a727480f2b4fbdc661cd9c3ffe47c1969631dc /meta/recipes-extended/mdadm
parentd9d208c532a730abc1e0afee399d3bd2f8183cd4 (diff)
downloadpoky-eba6cd155a7ad02b736566727f58a3958048bfc8.tar.gz
mdadm: make ptest output format align with common style
(From OE-Core rev: 99176bce7a185c996ef892b4f9b2617825a607fb) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/mdadm')
-rw-r--r--meta/recipes-extended/mdadm/files/run-ptest17
-rw-r--r--meta/recipes-extended/mdadm/mdadm_4.1.bb8
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 234f97376a..e4a9c2b08b 100644
--- a/meta/recipes-extended/mdadm/files/run-ptest
+++ b/meta/recipes-extended/mdadm/files/run-ptest
@@ -1,19 +1,4 @@
1#!/bin/sh 1#!/bin/sh
2 2
3LOG="$(pwd)/test.log"
4# make the test continue to execute even one fail 3# make the test continue to execute even one fail
5./test --keep-going 2>&1|tee ${LOG} 4./test --keep-going
6# translate the test report
7# "tests/18imsm-r10_4d-takeover-r0_2d... succeeded" -> "PASS: tests/18imsm-r10_4d-takeover-r0_2d"
8# "tests/19raid6repair... FAILED - see //log for details" -> "FAIL: tests/19raid6repair"
9sed -i -e '/succeeded/ s/^/PASS: /' -e '/FAILED/ s/^/FAIL: /' ${LOG}
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}
diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb b/meta/recipes-extended/mdadm/mdadm_4.1.bb
index 5df3f9087b..0cd9626f27 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() {
74 cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests 74 cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests
75 cp ${S}/test ${D}${PTEST_PATH} 75 cp ${S}/test ${D}${PTEST_PATH}
76 sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test 76 sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
77 sed -i -e '/echo -ne "$_script... "/d' \
78 -e 's/echo "succeeded"/echo -e "PASS: $_script"/g' \
79 -e '/save_log fail/N; /_fail=1/i\\t\t\techo -ne "FAIL: $_script"' \
80 -e '/die "dmesg prints errors when testing $_basename!"/i\\t\t\t\techo -ne "FAIL: $_script" &&' \
81 ${D}${PTEST_PATH}/test
82
83 chmod +x ${D}${PTEST_PATH}/test
84
77 ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm 85 ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
78 for prg in test_stripe swap_super raid6check 86 for prg in test_stripe swap_super raid6check
79 do 87 do