Skip to content

Commit

Permalink
selftests: run lib/test_printf module
Browse files Browse the repository at this point in the history
This runs the lib/test_printf module to make sure printf is operating
sanely.

Signed-off-by: Kees Cook <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kees authored and torvalds committed Nov 7, 2015
1 parent 707cc72 commit 317dc34
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ TARGETS += firmware
TARGETS += ftrace
TARGETS += futex
TARGETS += kcmp
TARGETS += lib
TARGETS += membarrier
TARGETS += memfd
TARGETS += memory-hotplug
Expand Down
8 changes: 8 additions & 0 deletions tools/testing/selftests/lib/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Makefile for lib/ function selftests

# No binaries, but make sure arg-less "make" doesn't trigger "run_tests"
all:

TEST_PROGS := printf.sh

include ../lib.mk
10 changes: 10 additions & 0 deletions tools/testing/selftests/lib/printf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# Runs printf infrastructure using test_printf kernel module

if /sbin/modprobe -q test_printf; then
/sbin/modprobe -q -r test_printf
echo "printf: ok"
else
echo "printf: [FAIL]"
exit 1
fi

0 comments on commit 317dc34

Please sign in to comment.