diff options
author | Kees Cook <keescook@chromium.org> | 2015-11-06 19:30:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-06 20:50:42 -0500 |
commit | 317dc34ab786d4f22bf7ed8ab546b9ae57f900d0 (patch) | |
tree | 14cbd98eca044d608c23f21d3947fc65e1202044 /tools/testing/selftests/lib | |
parent | 707cc7280f452a162c52bc240eae62568b9753c2 (diff) |
selftests: run lib/test_printf module
This runs the lib/test_printf module to make sure printf is operating
sanely.
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/lib')
-rw-r--r-- | tools/testing/selftests/lib/Makefile | 8 | ||||
-rw-r--r-- | tools/testing/selftests/lib/printf.sh | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/testing/selftests/lib/Makefile b/tools/testing/selftests/lib/Makefile new file mode 100644 index 000000000000..47147b968514 --- /dev/null +++ b/tools/testing/selftests/lib/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # Makefile for lib/ function selftests | ||
2 | |||
3 | # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" | ||
4 | all: | ||
5 | |||
6 | TEST_PROGS := printf.sh | ||
7 | |||
8 | include ../lib.mk | ||
diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh new file mode 100644 index 000000000000..4fdc70fe6980 --- /dev/null +++ b/tools/testing/selftests/lib/printf.sh | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/bin/sh | ||
2 | # Runs printf infrastructure using test_printf kernel module | ||
3 | |||
4 | if /sbin/modprobe -q test_printf; then | ||
5 | /sbin/modprobe -q -r test_printf | ||
6 | echo "printf: ok" | ||
7 | else | ||
8 | echo "printf: [FAIL]" | ||
9 | exit 1 | ||
10 | fi | ||