summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2022-08-11 13:19:44 +0200
committerFlorian Westphal <fw@strlen.de>2022-08-11 16:21:21 +0200
commitb9df658a5e384f80e88c1b45ba5c29f4b24bed13 (patch)
tree0cc2a2e1437113ac30291d74587add5f31050374 /tests
parentbe7be3995a769ae53568a86ba0b6e5469789cec1 (diff)
tests: shell: check for a tainted kernel
If a test case results in a kernel taint (WARN splat for example), make sure the test script indicates this. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/shell/run-tests.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 33006d2c..931bba96 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -109,8 +109,22 @@ find_tests() {
echo ""
ok=0
failed=0
+taint=0
+
+check_taint()
+{
+ read taint_now < /proc/sys/kernel/tainted
+ if [ $taint -ne $taint_now ] ; then
+ msg_warn "[FAILED] kernel is tainted: $taint -> $taint_now"
+ ((failed++))
+ fi
+}
+
+check_taint
+
for testfile in $(find_tests)
do
+ read taint < /proc/sys/kernel/tainted
kernel_cleanup
msg_info "[EXECUTING] $testfile"
@@ -155,6 +169,8 @@ do
msg_warn "[FAILED] $testfile"
fi
fi
+
+ check_taint
done
echo ""