1
0
Fork 0
alistair23-linux/tools/testing/selftests/firmware
Shuah Khan d9afe243a9 selftests: firmware: Fix it to do root uid check and skip
[ Upstream commit c65e41538b ]

firmware attempts to load test modules that require root access
and fail. Fix it to check for root uid and exit with skip code
instead.

Before this fix:

selftests: firmware: fw_run_tests.sh
modprobe: ERROR: could not insert 'test_firmware': Operation not permitted
You must have the following enabled in your kernel:
CONFIG_TEST_FIRMWARE=y
CONFIG_FW_LOADER=y
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP

With this fix:

selftests: firmware: fw_run_tests.sh
skip all tests: must be run as root
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Reviwed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-17 19:49:04 +01:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
config Revert "selftests: firmware: add CONFIG_FW_LOADER_USER_HELPER_FALLBACK to config" 2019-02-08 13:00:43 +01:00
fw_fallback.sh selftests: firmware: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
fw_filesystem.sh selftests: firmware: Add request_firmware_into_buf tests 2019-09-04 13:31:28 +02:00
fw_lib.sh selftests: firmware: Fix it to do root uid check and skip 2020-01-17 19:49:04 +01:00
fw_run_tests.sh selftests: firmware: Add compressed firmware tests 2019-06-18 09:11:22 +02:00