tools/testing/selftests/sysctl/sysctl.sh: allow graceful use on older kernels
authorLuis Chamberlain <mcgrof@kernel.org>
Tue, 14 May 2019 22:45:07 +0000 (15:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 May 2019 02:52:51 +0000 (19:52 -0700)
commita0edef79685c508fde517e6defac23b3ba60c422
tree3cd06d3baf9d18d4d1a3e872166c52b350201bfd
parent8ded3d1026b26240eaa285b98b7942d27f657355
tools/testing/selftests/sysctl/sysctl.sh: allow graceful use on older kernels

On old kernels older new test knobs implemented on the test_sysctl
module may not be available.  This is expected, and the selftests test
scripts should be able to run without failures on older kernels.

Generalize a solution so that we test for each required test target file
for each test by requiring each test description to annotate their
respective test target file.  If the target file does not exist, we skip
the test gracefully.

Link: http://lkml.kernel.org/r/20190320222831.8243-5-mcgrof@kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Eric Sandeen <sandeen@redhat.com>
Cc: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/sysctl/sysctl.sh