summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/lkdtm
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2020-06-25 13:37:03 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-29 18:41:39 +0200
commit4fccc8c0ff740e62343b6de38426a48b345b95f4 (patch)
treecd1e695211b829208c06b2b31373cec26eeb787a /tools/testing/selftests/lkdtm
parente12145cf1c3a8077e6d9f575711e38dd7d8a3ebc (diff)
selftests/lkdtm: Reset WARN_ONCE to avoid false negatives
Since we expect to see warnings every time for many tests, just reset the WARN_ONCE flags each time the script runs. Fixes: 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets") Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20200625203704.317097-4-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/lkdtm')
-rwxr-xr-xtools/testing/selftests/lkdtm/run.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
index ee64ff8df8f4..8383eb89d88a 100755
--- a/tools/testing/selftests/lkdtm/run.sh
+++ b/tools/testing/selftests/lkdtm/run.sh
@@ -8,6 +8,7 @@
#
set -e
TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT
+CLEAR_ONCE=/sys/kernel/debug/clear_warn_once
KSELFTEST_SKIP_TEST=4
# Verify we have LKDTM available in the kernel.
@@ -67,6 +68,11 @@ cleanup() {
}
trap cleanup EXIT
+# Reset WARN_ONCE counters so we trip it each time this runs.
+if [ -w $CLEAR_ONCE ] ; then
+ echo 1 > $CLEAR_ONCE
+fi
+
# Save existing dmesg so we can detect new content below
dmesg > "$DMESG"