Commit 4fccc8c0 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman

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: 46d1a0f0 ("selftests/lkdtm: Add tests for LKDTM targets")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20200625203704.317097-4-keescook@chromium.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e12145cf
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# #
set -e set -e
TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT
CLEAR_ONCE=/sys/kernel/debug/clear_warn_once
KSELFTEST_SKIP_TEST=4 KSELFTEST_SKIP_TEST=4
# Verify we have LKDTM available in the kernel. # Verify we have LKDTM available in the kernel.
...@@ -67,6 +68,11 @@ cleanup() { ...@@ -67,6 +68,11 @@ cleanup() {
} }
trap cleanup EXIT 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 # Save existing dmesg so we can detect new content below
dmesg > "$DMESG" dmesg > "$DMESG"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment