aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()
256 set -e 256 set -e
257} 257}
258 258
259run_sysfs_main_tests 259run_sysfs_custom_load_tests()
260{
261 if load_fw_custom "$NAME" "$FW" ; then
262 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
263 echo "$0: firmware was not loaded" >&2
264 exit 1
265 else
266 echo "$0: custom fallback loading mechanism works"
267 fi
268 fi
260 269
261if load_fw_custom "$NAME" "$FW" ; then 270 if load_fw_custom "$NAME" "$FW" ; then
262 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then 271 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
263 echo "$0: firmware was not loaded" >&2 272 echo "$0: firmware was not loaded" >&2
264 exit 1 273 exit 1
265 else 274 else
266 echo "$0: custom fallback loading mechanism works" 275 echo "$0: custom fallback loading mechanism works"
276 fi
267 fi 277 fi
268fi
269 278
270if load_fw_custom_cancel "nope-$NAME" "$FW" ; then 279 if load_fw_custom_cancel "nope-$NAME" "$FW" ; then
271 if diff -q "$FW" /dev/test_firmware >/dev/null ; then 280 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
272 echo "$0: firmware was expected to be cancelled" >&2 281 echo "$0: firmware was expected to be cancelled" >&2
273 exit 1 282 exit 1
274 else 283 else
275 echo "$0: cancelling custom fallback mechanism works" 284 echo "$0: cancelling custom fallback mechanism works"
285 fi
276 fi 286 fi
277fi 287}
288
289run_sysfs_main_tests
290run_sysfs_custom_load_tests
278 291
279exit 0 292exit 0