diff options
Diffstat (limited to 'meta/recipes-extended/mdadm/files/run-ptest')
-rw-r--r-- | meta/recipes-extended/mdadm/files/run-ptest | 25 |
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 | 3 | LOG="$(pwd)/test.log" |
4 | if [ $? -eq 0 ] | 4 | # make the test continue to execute even one fail |
5 | then | 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" |
8 | else | 8 | # "tests/19raid6repair... FAILED - see //log for details" -> "FAIL: tests/19raid6repair" |
9 | echo "FAIL: mdadm" | 9 | sed -i -e '/succeeded/ s/^/PASS: /' -e '/FAILED/ s/^/FAIL: /' ${LOG} |
10 | fi | 10 | sed -i -e 's/... FAILED//g' -e 's/... succeeded//g' ${LOG} |
11 | passed=`grep PASS: ${LOG}|wc -l` | ||
12 | failed=`grep FAIL: ${LOG}|wc -l` | ||
13 | all=$((passed + failed)) | ||
14 | |||
15 | ( echo "=== Test Summary ===" | ||
16 | echo "TOTAL: ${all}" | ||
17 | echo "PASSED: ${passed}" | ||
18 | echo "FAILED: ${failed}" | ||
19 | ) | tee -a /${LOG} | ||