diff mbox series

[v3,4/5] tools/testing/selftests/sysctl/sysctl.sh: support CONFIG_TEST_SYSCTL=y

Message ID 20200427180433.7029-5-vbabka@suse.cz (mailing list archive)
State New, archived
Headers show
Series support setting sysctl parameters from kernel command line | expand

Commit Message

Vlastimil Babka April 27, 2020, 6:04 p.m. UTC
The testing script recommends CONFIG_TEST_SYSCTL=y, but actually only works
with CONFIG_TEST_SYSCTL=m. Testing of sysctl setting via boot param however
requires the test to be built-in, so make sure the test script supports it.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 tools/testing/selftests/sysctl/sysctl.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Luis Chamberlain April 27, 2020, 6:39 p.m. UTC | #1
On Mon, Apr 27, 2020 at 08:04:32PM +0200, Vlastimil Babka wrote:
> The testing script recommends CONFIG_TEST_SYSCTL=y, but actually only works
> with CONFIG_TEST_SYSCTL=m. Testing of sysctl setting via boot param however
> requires the test to be built-in, so make sure the test script supports it.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Acked-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis
diff mbox series

Patch

diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh
index 6a970b127c9b..ce1eeea6f769 100755
--- a/tools/testing/selftests/sysctl/sysctl.sh
+++ b/tools/testing/selftests/sysctl/sysctl.sh
@@ -42,7 +42,7 @@  ALL_TESTS="$ALL_TESTS 0006:50:1:bitmap_0001"
 
 test_modprobe()
 {
-       if [ ! -d $DIR ]; then
+       if [ ! -d $SYSCTL ]; then
                echo "$0: $DIR not present" >&2
                echo "You must have the following enabled in your kernel:" >&2
                cat $TEST_DIR/config >&2
@@ -122,9 +122,9 @@  test_reqs()
 
 function load_req_mod()
 {
-	if [ ! -d $DIR ]; then
+	if [ ! -d $DIR -a ! -d $SYSCTL ]; then
 		if ! modprobe -q -n $TEST_DRIVER; then
-			echo "$0: module $TEST_DRIVER not found [SKIP]"
+			echo "$0: module $TEST_DRIVER not found and not built-in [SKIP]"
 			exit $ksft_skip
 		fi
 		modprobe $TEST_DRIVER