summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/firmware/fw_userhelper.sh
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@suse.com>2015-07-24 15:10:22 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-05 17:07:19 -0700
commit1d0fbb3467b5a82e33ab57f27b870c1b8275f45d (patch)
tree5a13e5a913b192f416e4b176e2af2bef9293e175 /tools/testing/selftests/firmware/fw_userhelper.sh
parent71cf5aeeb8e2154efda5f40be50c925f15057755 (diff)
selftests: firmware: skip timeout checks for kernels without user mode helper
The CONFIG_FW_LOADER_USER_HELPER is mostly disabled these days, so skip timeout setting for these kernels. Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/firmware/fw_userhelper.sh')
-rwxr-xr-xtools/testing/selftests/firmware/fw_userhelper.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/testing/selftests/firmware/fw_userhelper.sh b/tools/testing/selftests/firmware/fw_userhelper.sh
index 6efbade12139..b9983f8e09f6 100755
--- a/tools/testing/selftests/firmware/fw_userhelper.sh
+++ b/tools/testing/selftests/firmware/fw_userhelper.sh
@@ -9,7 +9,17 @@ modprobe test_firmware
DIR=/sys/devices/virtual/misc/test_firmware
-OLD_TIMEOUT=$(cat /sys/class/firmware/timeout)
+# CONFIG_FW_LOADER_USER_HELPER has a sysfs class under /sys/class/firmware/
+# These days no one enables CONFIG_FW_LOADER_USER_HELPER so check for that
+# as an indicator for CONFIG_FW_LOADER_USER_HELPER.
+HAS_FW_LOADER_USER_HELPER=$(if [ -d /sys/class/firmware/ ]; then echo yes; else echo no; fi)
+
+if [ "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then
+ OLD_TIMEOUT=$(cat /sys/class/firmware/timeout)
+else
+ echo "usermode helper disabled so ignoring test"
+ exit 0
+fi
FWPATH=$(mktemp -d)
FW="$FWPATH/test-firmware.bin"