All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] sysctl: kselftests: fix test_modprobe issue
@ 2018-09-06 10:22 ` Lei.Yang
  0 siblings, 0 replies; 9+ messages in thread
From: Lei Yang @ 2018-09-06 10:22 UTC (permalink / raw)
  To: mcgrof, lei.yang, linux-kselftest, linux-kernel

when CONFIG_TEST_SYSCTL=y, there is no "/sys/module/test_sysctl/"
when CONFIG_TEST_SYSCTL=m, checking /sys/module/test_sysctl/ is
before kernel module loading

you'll get below error message
root@intel-x86-64:/tmp/sysctl# ./sysctl.sh
Checking production write strict setting ... ok
./sysctl.sh: /sys/module/test_sysctl/ not present
You must have the following enabled in your kernel:

This patch will fix this issue.
when CONFIG_TEST_SYSCTL=y, it has no chance to check "/sys/module/test_sysctl/"
when CONFIG_TEST_SYSCTL=m, it will load kernel module first before checking sys
interface.

Signed-off-by: Lei Yang <Lei.Yang@windriver.com>
---
 tools/testing/selftests/sysctl/sysctl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh
index 584eb8e..08dc995 100755
--- a/tools/testing/selftests/sysctl/sysctl.sh
+++ b/tools/testing/selftests/sysctl/sysctl.sh
@@ -120,6 +120,7 @@ test_reqs()
 
 function load_req_mod()
 {
+        trap "test_modprobe" EXIT
 	if [ ! -d $DIR ]; then
 		if ! modprobe -q -n $TEST_DRIVER; then
 			echo "$0: module $TEST_DRIVER not found [SKIP]"
@@ -770,7 +771,6 @@ function parse_args()
 test_reqs
 allow_user_defaults
 check_production_sysctl_writes_strict
-test_modprobe
 load_req_mod
 
 trap "test_finish" EXIT
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-21 22:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 10:22 [PATCH v2] sysctl: kselftests: fix test_modprobe issue Lei Yang
2018-09-06 10:22 ` Lei Yang
2018-09-06 10:22 ` Lei.Yang
2018-10-09  7:29 ` Anders Roxell
2018-10-09  7:29   ` Anders Roxell
2018-10-09  7:29   ` anders.roxell
2018-11-21 22:27 ` Luis Chamberlain
2018-11-21 22:27   ` Luis Chamberlain
2018-11-21 22:27   ` mcgrof

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.