diff options
Diffstat (limited to 'kernel/tools/testing/selftests/static_keys')
-rw-r--r-- | kernel/tools/testing/selftests/static_keys/Makefile | 8 | ||||
-rwxr-xr-x | kernel/tools/testing/selftests/static_keys/test_static_keys.sh | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/kernel/tools/testing/selftests/static_keys/Makefile b/kernel/tools/testing/selftests/static_keys/Makefile new file mode 100644 index 000000000..9cdadf37f --- /dev/null +++ b/kernel/tools/testing/selftests/static_keys/Makefile @@ -0,0 +1,8 @@ +# Makefile for static keys selftests + +# No binaries, but make sure arg-less "make" doesn't trigger "run_tests" +all: + +TEST_PROGS := test_static_keys.sh + +include ../lib.mk diff --git a/kernel/tools/testing/selftests/static_keys/test_static_keys.sh b/kernel/tools/testing/selftests/static_keys/test_static_keys.sh new file mode 100755 index 000000000..1261e3fa1 --- /dev/null +++ b/kernel/tools/testing/selftests/static_keys/test_static_keys.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Runs static keys kernel module tests + +if /sbin/modprobe -q test_static_key_base; then + if /sbin/modprobe -q test_static_keys; then + echo "static_key: ok" + /sbin/modprobe -q -r test_static_keys + /sbin/modprobe -q -r test_static_key_base + else + echo "static_keys: [FAIL]" + /sbin/modprobe -q -r test_static_key_base + fi +else + echo "static_key: [FAIL]" + exit 1 +fi |