mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuah@kernel.org>
To: Sumit Semwal <sumit.semwal@linaro.org>, linux-kselftest@vger.kernel.org
Cc: keescook@chromium.org, decot@googlers.com,
	linux-kernel@vger.kernel.org, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] selftests: lib: Skip tests on missing test modules
Date: Fri, 16 Jun 2017 09:10:04 -0600	[thread overview]
Message-ID: <8c406bd0-bba9-59ec-2240-43d849c36062@kernel.org> (raw)
In-Reply-To: <1497590965-12310-1-git-send-email-sumit.semwal@linaro.org>

Hi Sumit,

On 06/15/2017 11:29 PM, Sumit Semwal wrote:
> With older kernels, printf.sh and bitmap.sh fail because they can't find
> the respective test modules they are looking for.
> 
> Add the skip portion on missing the respective test_XXX module. Error out
> the same way as prime_numbers.sh.
> 
> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
> ---
>  tools/testing/selftests/lib/bitmap.sh | 5 +++++
>  tools/testing/selftests/lib/printf.sh | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh
> index 2da187b6ddad..85294b4a0861 100755
> --- a/tools/testing/selftests/lib/bitmap.sh
> +++ b/tools/testing/selftests/lib/bitmap.sh
> @@ -1,6 +1,11 @@
>  #!/bin/sh
>  # Runs bitmap infrastructure tests using test_bitmap kernel module
>  
> +if ! /sbin/modprobe -q test_bitmap; then
> +        echo "bitmap: [SKIP]"
> +	exit 77
> +fi

Please add this logic below in the else clause instead of
adding duplicate block.

I think it is would be good to differentiate when a modules
isn't present vs. modprobe failed keying off of

"Module test_printf not found" message.

The second one can be separate patch.

> +
>  if /sbin/modprobe -q test_bitmap; then
>  	/sbin/modprobe -q -r test_bitmap
>  	echo "bitmap: ok"
> diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh
> index 4fdc70fe6980..024e749a83d4 100755
> --- a/tools/testing/selftests/lib/printf.sh
> +++ b/tools/testing/selftests/lib/printf.sh
> @@ -1,6 +1,11 @@
>  #!/bin/sh
>  # Runs printf infrastructure using test_printf kernel module
>  
> +if ! /sbin/modprobe -q test_printf; then
> +        echo "printf: [SKIP]"
> +	exit 77
> +fi

Please add this logic below in the else clause instead of
adding duplicate block.

I think it is would be good to differentiate when a modules
isn't present vs. modprobe failed keying off of

"Module test_printf not found" message.

The second one can be separate patch.

> +
>  if /sbin/modprobe -q test_printf; then
>  	/sbin/modprobe -q -r test_printf
>  	echo "printf: ok"
> 

thanks,
-- Shuah

  reply	other threads:[~2017-06-16 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  5:29 Sumit Semwal
2017-06-16 15:10 ` Shuah Khan [this message]
2017-06-16 16:01   ` Shuah Khan

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=8c406bd0-bba9-59ec-2240-43d849c36062@kernel.org \
    --to=shuah@kernel.org \
    --cc=decot@googlers.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sumit.semwal@linaro.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®