mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuah@kernel.org>
To: Amit Pundir <amit.pundir@linaro.org>,
	kselftest <linux-kselftest@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Luis R . Rodriguez" <mcgrof@kernel.org>,
	Masami Hiramatsu <masami.hiramatsu@linaro.org>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests
Date: Wed, 8 Nov 2017 09:34:50 -0700	[thread overview]
Message-ID: <4d94c89b-45cc-0238-bc4f-15f796693e84@kernel.org> (raw)
In-Reply-To: <1510141660-31612-3-git-send-email-amit.pundir@linaro.org>

On 11/08/2017 04:47 AM, Amit Pundir wrote:
> Ignore custom firmware loading and cancellation tests on older
> kernel releases, which do not support this feature.
> 
> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
> ---
>  tools/testing/selftests/firmware/fw_fallback.sh | 38 +++++++++++++++++--------
>  1 file changed, 26 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh
> index a52a3bab532b..72858c921eed 100755
> --- a/tools/testing/selftests/firmware/fw_fallback.sh
> +++ b/tools/testing/selftests/firmware/fw_fallback.sh
> @@ -86,6 +86,11 @@ load_fw_cancel()
>  
>  load_fw_custom()
>  {
> +	if [ ! -e "$DIR"/trigger_custom_fallback ]; then
> +		echo "$0: custom fallback loading trigger not supported" >&2

Please make this message consistent with the rest when a test is ignored
as in the following to make it clear what is being done.

fw_fallback.sh:	echo "usermode helper disabled so ignoring test"
fw_filesystem.sh:		echo "Configuration triggers not present, ignoring test"

> +		return 1
> +	fi
> +
>  	local name="$1"
>  	local file="$2"
>  
> @@ -108,11 +113,17 @@ load_fw_custom()
>  
>  	# Wait for request to finish.
>  	wait
> +	return 0
>  }
>  
>  
>  load_fw_custom_cancel()
>  {
> +	if [ ! -e "$DIR"/trigger_custom_fallback ]; then
> +		echo "$0: cancelling custom fallback trigger not supported" >&2

Please make this message consistent with the rest when a test is ignored
as in the following to make it clear what is being done.

fw_fallback.sh:	echo "usermode helper disabled so ignoring test"
fw_filesystem.sh:		echo "Configuration triggers not present, ignoring test"

If I missed ponting out any other instances of ignoring, please do the
same for them.

> +		return 1
> +	fi
> +
>  	local name="$1"
>  	local file="$2"
>  
> @@ -133,6 +144,7 @@ load_fw_custom_cancel()
>  
>  	# Wait for request to finish.
>  	wait
> +	return 0
>  }
>  
>  load_fw_fallback_with_child()
> @@ -227,20 +239,22 @@ else
>  	echo "$0: cancelling fallback mechanism works"
>  fi
>  
> -load_fw_custom "$NAME" "$FW"
> -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
> -	echo "$0: firmware was not loaded" >&2
> -	exit 1
> -else
> -	echo "$0: custom fallback loading mechanism works"
> +if load_fw_custom "$NAME" "$FW" ; then
> +	if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
> +		echo "$0: firmware was not loaded" >&2
> +		exit 1
> +	else
> +		echo "$0: custom fallback loading mechanism works"
> +	fi
>  fi
>  
> -load_fw_custom_cancel "nope-$NAME" "$FW"
> -if diff -q "$FW" /dev/test_firmware >/dev/null ; then
> -	echo "$0: firmware was expected to be cancelled" >&2
> -	exit 1
> -else
> -	echo "$0: cancelling custom fallback mechanism works"
> +if load_fw_custom_cancel "nope-$NAME" "$FW" ; then
> +	if diff -q "$FW" /dev/test_firmware >/dev/null ; then
> +		echo "$0: firmware was expected to be cancelled" >&2
> +		exit 1
> +	else
> +		echo "$0: cancelling custom fallback mechanism works"
> +	fi
>  fi
>  
>  set +e
> 

thanks,
-- Shuah

  parent reply	other threads:[~2017-11-08 16:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 11:47 [PATCH 0/2] selftests: firmware: skip testing unsupported features Amit Pundir
2017-11-08 11:47 ` [PATCH 1/2] selftests: firmware: skip unsupported async loading tests Amit Pundir
2017-11-08 12:41   ` Greg Kroah-Hartman
2017-11-08 16:29   ` Shuah Khan
2017-11-08 11:47 ` [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests Amit Pundir
2017-11-08 12:41   ` Greg Kroah-Hartman
2017-11-08 16:34   ` Shuah Khan [this message]
2017-11-08 12:46 ` [PATCH 0/2] selftests: firmware: skip testing unsupported features Sumit Semwal
2017-11-08 16:28 ` Shuah Khan
2017-11-08 16:49 ` Luis R. Rodriguez

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=4d94c89b-45cc-0238-bc4f-15f796693e84@kernel.org \
    --to=shuah@kernel.org \
    --cc=amit.pundir@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=masami.hiramatsu@linaro.org \
    --cc=mcgrof@kernel.org \
    --cc=shuahkh@osg.samsung.com \
    --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®