From: Luis Chamberlain <mcgrof@kernel.org>
To: Lei Yang <Lei.Yang@windriver.com>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sysctl: kselftests: fix test_modprobe issue
Date: Wed, 21 Nov 2018 14:27:30 -0800 [thread overview]
Message-ID: <20181121222730.GA4922@garbanzo.do-not-panic.com> (raw)
In-Reply-To: <1536229374-25699-1-git-send-email-Lei.Yang@windriver.com>
On Thu, Sep 06, 2018 at 06:22:54PM +0800, Lei Yang wrote:
> 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
Better yet, we can just depend on /proc/config stuff for test modules,
refer to check_mods() on tools/testing/selftests/firmware/fw_lib.sh.
Feel free to make helpers if you can come up with a generic directory,
otherwise just duplicate the effort for now.
Luis
prev parent reply other threads:[~2018-11-21 22:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-06 10:22 Lei Yang
2018-10-09 7:29 ` Anders Roxell
2018-11-21 22:27 ` Luis Chamberlain [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181121222730.GA4922@garbanzo.do-not-panic.com \
--to=mcgrof@kernel.org \
--cc=Lei.Yang@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®