Skip to content

Commit

Permalink
test_sysctl: add generic script to expand on tests
Browse files Browse the repository at this point in the history
This adds a generic script to let us more easily add more tests cases.
Since we really have only two types of tests cases just fold them into
the one file.  Each test unit is now identified into its separate
function:

    # ./sysctl.sh -l
  Test ID list:

  TEST_ID x NUM_TEST
  TEST_ID:   Test ID
  NUM_TESTS: Number of recommended times to run the test

  0001 x 1 - tests proc_dointvec_minmax()
  0002 x 1 - tests proc_dostring()

For now we start off with what we had before, and run only each test
once.  We can now watch a test case until it fails:

  ./sysctl.sh -w 0002

We can also run a test case x number of times, say we want to run a test
case 100 times:

  ./sysctl.sh -c 0001 100

To run a test case only once, for example:

  ./sysctl.sh -s 0002

The default settings are specified at the top of sysctl.sh.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Luis R. Rodriguez <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Shuah Khan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mcgrof authored and torvalds committed Jul 12, 2017
1 parent 9308f2f commit 64b6712
Show file tree
Hide file tree
Showing 5 changed files with 495 additions and 220 deletions.
3 changes: 1 addition & 2 deletions tools/testing/selftests/sysctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# No binaries, but make sure arg-less "make" doesn't trigger "run_tests".
all:

TEST_PROGS := run_numerictests run_stringtests
TEST_FILES := common_tests
TEST_PROGS := sysctl.sh

include ../lib.mk

Expand Down
131 changes: 0 additions & 131 deletions tools/testing/selftests/sysctl/common_tests

This file was deleted.

10 changes: 0 additions & 10 deletions tools/testing/selftests/sysctl/run_numerictests

This file was deleted.

77 changes: 0 additions & 77 deletions tools/testing/selftests/sysctl/run_stringtests

This file was deleted.

Loading

0 comments on commit 64b6712

Please sign in to comment.