* [PATCH 0/2] selftests: firmware: skip testing unsupported features
@ 2017-11-08 11:47 Amit Pundir
2017-11-08 11:47 ` [PATCH 1/2] selftests: firmware: skip unsupported async loading tests Amit Pundir
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Amit Pundir @ 2017-11-08 11:47 UTC (permalink / raw)
To: kselftest, lkml
Cc: Shuah Khan, Greg Kroah-Hartman, Luis R . Rodriguez,
Masami Hiramatsu, Sumit Semwal
Hi,
At Linaro we run mainline/linux-next selftests on LTS releases and
run into few test failures due to kernel mismatch or missing upstream
functionality in older kernels. Discussed at length here:
https://lkml.org/lkml/2017/6/15/652
This patch series is an attempt to modify selftest firmware test scripts.
The proposed changes skip/ignore testing the upstream functionality
missing in the older kernel releases.
Regards,
Amit Pundir
Amit Pundir (2):
selftests: firmware: skip unsupported async loading tests
selftests: firmware: skip unsupported custom firmware fallback tests
tools/testing/selftests/firmware/fw_fallback.sh | 38 ++++++++++++++++-------
tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++--------
2 files changed, 47 insertions(+), 25 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] selftests: firmware: skip unsupported async loading tests
2017-11-08 11:47 [PATCH 0/2] selftests: firmware: skip testing unsupported features Amit Pundir
@ 2017-11-08 11:47 ` 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
` (3 subsequent siblings)
4 siblings, 2 replies; 10+ messages in thread
From: Amit Pundir @ 2017-11-08 11:47 UTC (permalink / raw)
To: kselftest, lkml
Cc: Shuah Khan, Greg Kroah-Hartman, Luis R . Rodriguez,
Masami Hiramatsu, Sumit Semwal
Ignore async firmware loading 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_filesystem.sh | 34 ++++++++++++++---------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
index 62f2d6f54929..b1f20fef36c7 100755
--- a/tools/testing/selftests/firmware/fw_filesystem.sh
+++ b/tools/testing/selftests/firmware/fw_filesystem.sh
@@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then
exit 1
fi
-if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
- echo "$0: empty filename should not succeed (async)" >&2
- exit 1
+if [ ! -e "$DIR"/trigger_async_request ]; then
+ echo "$0: empty filename: async trigger not supported" >&2
+else
+ if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
+ echo "$0: empty filename should not succeed (async)" >&2
+ exit 1
+ fi
fi
# Request a firmware that doesn't exist, it should fail.
@@ -105,17 +109,21 @@ else
fi
# Try the asynchronous version too
-if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
- echo "$0: could not trigger async request" >&2
- exit 1
-fi
-
-# Verify the contents are what we expect.
-if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
- echo "$0: firmware was not loaded (async)" >&2
- exit 1
+if [ ! -e "$DIR"/trigger_async_request ]; then
+ echo "$0: firmware loading: async trigger not supported" >&2
else
- echo "$0: async filesystem loading works"
+ if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
+ echo "$0: could not trigger async request" >&2
+ exit 1
+ fi
+
+ # Verify the contents are what we expect.
+ if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
+ echo "$0: firmware was not loaded (async)" >&2
+ exit 1
+ else
+ echo "$0: async filesystem loading works"
+ fi
fi
### Batched requests tests
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests
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 11:47 ` Amit Pundir
2017-11-08 12:41 ` Greg Kroah-Hartman
2017-11-08 16:34 ` Shuah Khan
2017-11-08 12:46 ` [PATCH 0/2] selftests: firmware: skip testing unsupported features Sumit Semwal
` (2 subsequent siblings)
4 siblings, 2 replies; 10+ messages in thread
From: Amit Pundir @ 2017-11-08 11:47 UTC (permalink / raw)
To: kselftest, lkml
Cc: Shuah Khan, Greg Kroah-Hartman, Luis R . Rodriguez,
Masami Hiramatsu, Sumit Semwal
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
+ 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
+ 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
--
2.7.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] selftests: firmware: skip unsupported async loading tests
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
1 sibling, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2017-11-08 12:41 UTC (permalink / raw)
To: Amit Pundir
Cc: kselftest, lkml, Shuah Khan, Luis R . Rodriguez,
Masami Hiramatsu, Sumit Semwal
On Wed, Nov 08, 2017 at 05:17:39PM +0530, Amit Pundir wrote:
> Ignore async firmware loading tests on older kernel releases,
> which do not support this feature.
>
> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests
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
1 sibling, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2017-11-08 12:41 UTC (permalink / raw)
To: Amit Pundir
Cc: kselftest, lkml, Shuah Khan, Luis R . Rodriguez,
Masami Hiramatsu, Sumit Semwal
On Wed, Nov 08, 2017 at 05:17:40PM +0530, 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>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] selftests: firmware: skip testing unsupported features
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 11:47 ` [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests Amit Pundir
@ 2017-11-08 12:46 ` Sumit Semwal
2017-11-08 16:28 ` Shuah Khan
2017-11-08 16:49 ` Luis R. Rodriguez
4 siblings, 0 replies; 10+ messages in thread
From: Sumit Semwal @ 2017-11-08 12:46 UTC (permalink / raw)
To: Amit Pundir
Cc: kselftest, lkml, Shuah Khan, Greg Kroah-Hartman,
Luis R . Rodriguez, Masami Hiramatsu
Hi Amit,
Thanks for your patches.
On 8 November 2017 at 17:17, Amit Pundir <amit.pundir@linaro.org> wrote:
> Hi,
>
> At Linaro we run mainline/linux-next selftests on LTS releases and
> run into few test failures due to kernel mismatch or missing upstream
> functionality in older kernels. Discussed at length here:
> https://lkml.org/lkml/2017/6/15/652
>
> This patch series is an attempt to modify selftest firmware test scripts.
> The proposed changes skip/ignore testing the upstream functionality
> missing in the older kernel releases.
>
> Regards,
> Amit Pundir
>
>
> Amit Pundir (2):
> selftests: firmware: skip unsupported async loading tests
> selftests: firmware: skip unsupported custom firmware fallback tests
Please feel free to add my
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
to both these patches.
>
> tools/testing/selftests/firmware/fw_fallback.sh | 38 ++++++++++++++++-------
> tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++--------
> 2 files changed, 47 insertions(+), 25 deletions(-)
>
> --
> 2.7.4
>
Best,
Sumit.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] selftests: firmware: skip testing unsupported features
2017-11-08 11:47 [PATCH 0/2] selftests: firmware: skip testing unsupported features Amit Pundir
` (2 preceding siblings ...)
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
4 siblings, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2017-11-08 16:28 UTC (permalink / raw)
To: Amit Pundir, kselftest, lkml
Cc: Greg Kroah-Hartman, Luis R . Rodriguez, Masami Hiramatsu,
Sumit Semwal, Shuah Khan, Shuah Khan
On 11/08/2017 04:47 AM, Amit Pundir wrote:
> Hi,
>
> At Linaro we run mainline/linux-next selftests on LTS releases and
> run into few test failures due to kernel mismatch or missing upstream
> functionality in older kernels. Discussed at length here:
> https://lkml.org/lkml/2017/6/15/652
>
> This patch series is an attempt to modify selftest firmware test scripts.
> The proposed changes skip/ignore testing the upstream functionality
> missing in the older kernel releases.
>
> Regards,
> Amit Pundir
>
>
> Amit Pundir (2):
> selftests: firmware: skip unsupported async loading tests
> selftests: firmware: skip unsupported custom firmware fallback tests
>
> tools/testing/selftests/firmware/fw_fallback.sh | 38 ++++++++++++++++-------
> tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++--------
> 2 files changed, 47 insertions(+), 25 deletions(-)
>
Thanks for the patches. I have couple of minor comments on the patches.
Please see the individual responses to the patches.
-- Shuah
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] selftests: firmware: skip unsupported async loading tests
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
1 sibling, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2017-11-08 16:29 UTC (permalink / raw)
To: Amit Pundir, kselftest, lkml
Cc: Greg Kroah-Hartman, Luis R . Rodriguez, Masami Hiramatsu,
Sumit Semwal, Shuah Khan, Shuah Khan
On 11/08/2017 04:47 AM, Amit Pundir wrote:
> Ignore async firmware loading 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_filesystem.sh | 34 ++++++++++++++---------
> 1 file changed, 21 insertions(+), 13 deletions(-)
>
> diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
> index 62f2d6f54929..b1f20fef36c7 100755
> --- a/tools/testing/selftests/firmware/fw_filesystem.sh
> +++ b/tools/testing/selftests/firmware/fw_filesystem.sh
> @@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then
> exit 1
> fi
>
> -if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
> - echo "$0: empty filename should not succeed (async)" >&2
> - exit 1
> +if [ ! -e "$DIR"/trigger_async_request ]; then
> + echo "$0: empty filename: async trigger not supported" >&2
> +else
> + if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
> + echo "$0: empty filename should not succeed (async)" >&2
> + exit 1
> + fi
> fi
>
> # Request a firmware that doesn't exist, it should fail.
> @@ -105,17 +109,21 @@ else
> fi
>
> # Try the asynchronous version too
> -if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
> - echo "$0: could not trigger async request" >&2
> - exit 1
> -fi
> -
> -# Verify the contents are what we expect.
> -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
> - echo "$0: firmware was not loaded (async)" >&2
> - exit 1
> +if [ ! -e "$DIR"/trigger_async_request ]; then
> + echo "$0: firmware loading: async trigger not supported" >&2
Please make this message consistent with the rest when a test is ignored
as in the following tomake 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"
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] selftests: firmware: skip unsupported custom firmware fallback tests
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
1 sibling, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2017-11-08 16:34 UTC (permalink / raw)
To: Amit Pundir, kselftest, lkml
Cc: Greg Kroah-Hartman, Luis R . Rodriguez, Masami Hiramatsu,
Sumit Semwal, Shuah Khan, Shuah Khan
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] selftests: firmware: skip testing unsupported features
2017-11-08 11:47 [PATCH 0/2] selftests: firmware: skip testing unsupported features Amit Pundir
` (3 preceding siblings ...)
2017-11-08 16:28 ` Shuah Khan
@ 2017-11-08 16:49 ` Luis R. Rodriguez
4 siblings, 0 replies; 10+ messages in thread
From: Luis R. Rodriguez @ 2017-11-08 16:49 UTC (permalink / raw)
To: Amit Pundir
Cc: kselftest, lkml, Shuah Khan, Greg Kroah-Hartman,
Luis R . Rodriguez, Masami Hiramatsu, Sumit Semwal
On Wed, Nov 08, 2017 at 05:17:38PM +0530, Amit Pundir wrote:
> Hi,
>
> At Linaro we run mainline/linux-next selftests on LTS releases and
> run into few test failures due to kernel mismatch or missing upstream
> functionality in older kernels. Discussed at length here:
> https://lkml.org/lkml/2017/6/15/652
>
> This patch series is an attempt to modify selftest firmware test scripts.
> The proposed changes skip/ignore testing the upstream functionality
> missing in the older kernel releases.
>
> Regards,
> Amit Pundir
>
>
> Amit Pundir (2):
> selftests: firmware: skip unsupported async loading tests
> selftests: firmware: skip unsupported custom firmware fallback tests
For both, if you re-send with a Fixes tag that would be appreciated, there
is tooling now in place so that when a Fixes tag is used maintainers in
a distro kernel merge these patches as well when relevant. If you can
resend with that tag, or if Shuah is willing to amend the commit log
with them if you provide it:
Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>
Luis
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-11-08 16:49 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).