]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
tests: support to skip checking dmesg
authorYu Kuai <yukuai3@huawei.com>
Mon, 29 May 2023 13:28:20 +0000 (21:28 +0800)
committerJes Sorensen <jes@trained-monkey.org>
Thu, 26 Oct 2023 21:24:28 +0000 (17:24 -0400)
Prepare to add a regression test for raid10 that require error injection
to trigger error path, and kernel will complain about io error, checking
dmesg for error log will make it impossible to pass this test.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
test

diff --git a/test b/test
index 61d9ee83226e32f67df3d9f1289ebf98732ff8a3..b244453b1ceccd74c45af5e53dffdd0bef09c740 100755 (executable)
--- a/test
+++ b/test
@@ -107,8 +107,12 @@ do_test() {
                echo -ne "$_script... "
                if ( set -ex ; . $_script ) &> $targetdir/log
                then
-                       dmesg | grep -iq "error\|call trace\|segfault" &&
-                               die "dmesg prints errors when testing $_basename!"
+                       if [ -f "${_script}.inject_error" ]; then
+                               echo "dmesg checking is skipped because test inject error"
+                       else
+                               dmesg | grep -iq "error\|call trace\|segfault" &&
+                                       die "dmesg prints errors when testing $_basename!"
+                       fi
                        echo "succeeded"
                        _fail=0
                else