Skip to contentSkip to conversation

selftests/lkdtm: Add tests for LKDTM targets

PATCH Superseded Kees Cook 1 participant 1 message May 9, 2019

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 selftests/lkdtm: Add tests for LKDTM targets

This adds a basic framework for running all the "safe" lkdtm tests.

Signed-off-by Kees Cook <keescook at chromium.org>
---
 MAINTAINERS                             |  1 +
 tools/testing/selftests/Makefile        |  1 +
 tools/testing/selftests/lkdtm/Makefile  | 11 ++++
 tools/testing/selftests/lkdtm/config    |  1 +
 tools/testing/selftests/lkdtm/run.sh    | 86 +++++++++++++++++++++++++
 tools/testing/selftests/lkdtm/tests.txt | 64 ++++++++++++++++++
 6 files changed, 164 insertions(+)
 create mode 100644 tools/testing/selftests/lkdtm/Makefile
 create mode 100644 tools/testing/selftests/lkdtm/config
 create mode 100755 tools/testing/selftests/lkdtm/run.sh
 create mode 100644 tools/testing/selftests/lkdtm/tests.txt
MAINTAINERS +1 -0
index 2c2fce72e694..055f1a09b1da 100644
@@ -8977,6 +8977,7 @@ LINUX KERNEL DUMP TEST MODULE (LKDTM)
 M:	Kees Cook <keescook at chromium.org>
 S:	Maintained
 F:	drivers/misc/lkdtm/*
+F:	tools/testing/selftests/lkdtm/*
 
 LINUX KERNEL MEMORY CONSISTENCY MODEL (LKMM)
 M:	Alan Stern <stern at rowland.harvard.edu>
tools/testing/selftests/Makefile +1 -0
index 971fc8428117..c2397baeb777 100644
@@ -23,6 +23,7 @@ TARGETS += kcmp
 TARGETS += kvm
 TARGETS += lib
 TARGETS += livepatch
+TARGETS += lkdtm
 TARGETS += membarrier
 TARGETS += memfd
 TARGETS += memory-hotplug
tools/testing/selftests/lkdtm/Makefile new file +11 -0
new file mode 100644
index 000000000000..f322d281fd8e
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0
+# Makefile for LKDTM regression tests
+
+include ../lib.mk
+
+# NOTE: $(OUTPUT) won't get default value if used before lib.mk
+TEST_GEN_PROGS = $(patsubst %,$(OUTPUT)/%.sh,$(shell awk '{print $$1}' tests.txt | sed -e 's/\#//'))
+all: $(TEST_GEN_PROGS)
+
+$(OUTPUT)/%: run.sh tests.txt
+	install -m 0744 run.sh $@
tools/testing/selftests/lkdtm/config new file +1 -0
new file mode 100644
index 000000000000..d874990e442b
@@ -0,0 +1 @@
+CONFIG_LKDTM=y
tools/testing/selftests/lkdtm/run.sh new file +86 -0

86 lines not on this page · raw message

tools/testing/selftests/lkdtm/tests.txt new file +64 -0

64 lines not on this page · raw message

Signature · 5 lines
2.17.1


-- 
Kees Cook