automated: linux: modules: scan dmesg for errors
Add a helper function to scan dmesg after each module insert and remove,
looking for common kernel error signatures like "BUG:", "Oops:",
"WARNING:", and "Call Trace:".
This improves early detection of subtle regressions during module
load/unload testing that may otherwise go unnoticed.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
diff --git a/automated/linux/modules/modules.sh b/automated/linux/modules/modules.sh
index b6e5e81..9beefa5 100755
--- a/automated/linux/modules/modules.sh
+++ b/automated/linux/modules/modules.sh
@@ -76,6 +76,11 @@
fi
}
+scan_dmesg_for_errors() {
+ echo "=== Scanning dmesg for errors ==="
+ dmesg -l 0,1,2,3,4,5 | grep -Ei "BUG:|WARNING:|Oops:|Call Trace:" && report_fail "dmesg_error_scan" || report_pass "dmesg_error_scan"
+}
+
run () {
for module in ${MODULES_LIST}; do
# don't insert/remove modules that is already inserted.
@@ -86,8 +91,10 @@
echo
echo "modinfo ${module}"
modinfo "${module}"
+ scan_dmesg_for_errors
+
report "--remove" "${module}" "remove" "${num}"
- dmesg -l 0,1,2,3,4,5
+ scan_dmesg_for_errors
done
fi
done