提交 c3e0d179 编写于 作者: A Amit Pundir 提交者: Shuah Khan

selftests: firmware: skip unsupported custom firmware fallback tests

Ignore custom firmware loading and cancellation tests on older
kernel releases, which do not support this feature.

Fixes: 061132d2 ("test_firmware: add test custom fallback trigger")
Reviewed-by: NSumit Semwal <sumit.semwal@linaro.org>
Acked-by: NLuis R. Rodriguez <mcgrof@kernel.org>
Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NAmit Pundir <amit.pundir@linaro.org>
Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
上级 157339a1
...@@ -86,6 +86,11 @@ load_fw_cancel() ...@@ -86,6 +86,11 @@ load_fw_cancel()
load_fw_custom() load_fw_custom()
{ {
if [ ! -e "$DIR"/trigger_custom_fallback ]; then
echo "$0: custom fallback trigger not present, ignoring test" >&2
return 1
fi
local name="$1" local name="$1"
local file="$2" local file="$2"
...@@ -108,11 +113,17 @@ load_fw_custom() ...@@ -108,11 +113,17 @@ load_fw_custom()
# Wait for request to finish. # Wait for request to finish.
wait wait
return 0
} }
load_fw_custom_cancel() load_fw_custom_cancel()
{ {
if [ ! -e "$DIR"/trigger_custom_fallback ]; then
echo "$0: canceling custom fallback trigger not present, ignoring test" >&2
return 1
fi
local name="$1" local name="$1"
local file="$2" local file="$2"
...@@ -133,6 +144,7 @@ load_fw_custom_cancel() ...@@ -133,6 +144,7 @@ load_fw_custom_cancel()
# Wait for request to finish. # Wait for request to finish.
wait wait
return 0
} }
load_fw_fallback_with_child() load_fw_fallback_with_child()
...@@ -227,20 +239,22 @@ else ...@@ -227,20 +239,22 @@ else
echo "$0: cancelling fallback mechanism works" echo "$0: cancelling fallback mechanism works"
fi fi
load_fw_custom "$NAME" "$FW" if load_fw_custom "$NAME" "$FW" ; then
if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was not loaded" >&2 echo "$0: firmware was not loaded" >&2
exit 1 exit 1
else else
echo "$0: custom fallback loading mechanism works" echo "$0: custom fallback loading mechanism works"
fi
fi fi
load_fw_custom_cancel "nope-$NAME" "$FW" if load_fw_custom_cancel "nope-$NAME" "$FW" ; then
if diff -q "$FW" /dev/test_firmware >/dev/null ; then if diff -q "$FW" /dev/test_firmware >/dev/null ; then
echo "$0: firmware was expected to be cancelled" >&2 echo "$0: firmware was expected to be cancelled" >&2
exit 1 exit 1
else else
echo "$0: cancelling custom fallback mechanism works" echo "$0: cancelling custom fallback mechanism works"
fi
fi fi
set +e set +e
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册