aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/firmware
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2017-11-20 10:24:01 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-29 11:22:49 +0100
commit82bdf495169f2e4c25c5bd0f9384b687d358ebac (patch)
tree831fe8b80dd875c9ef19431e11246d22d7ebabc4 /tools/testing/selftests/firmware
parenttest_firmware: wrap basic sysfs fallback tests into helper (diff)
downloadlinux-dev-82bdf495169f2e4c25c5bd0f9384b687d358ebac.tar.xz
linux-dev-82bdf495169f2e4c25c5bd0f9384b687d358ebac.zip
test_firmware: wrap custom sysfs load tests into helper
These can run on certain kernel configs. This will allow us later to enable these tests under the right kernel configurations. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/firmware')
-rwxr-xr-xtools/testing/selftests/firmware/fw_fallback.sh43
1 files changed, 28 insertions, 15 deletions
diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh
index 0d4527c5e8a4..722cad91df74 100755
--- a/tools/testing/selftests/firmware/fw_fallback.sh
+++ b/tools/testing/selftests/firmware/fw_fallback.sh
@@ -256,24 +256,37 @@ run_sysfs_main_tests()
set -e
}
-run_sysfs_main_tests
+run_sysfs_custom_load_tests()
+{
+ 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
-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"
+ 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
-fi
-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"
+ 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
-fi
+}
+
+run_sysfs_main_tests
+run_sysfs_custom_load_tests
exit 0