]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: firmware: Fix it to do root uid check and skip
authorShuah Khan <skhan@linuxfoundation.org>
Fri, 13 Dec 2019 01:56:06 +0000 (18:56 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 23 Dec 2019 17:52:40 +0000 (10:52 -0700)
commit237bdb8eac65a8d85cd659aad01eae50261b454d
treed3f967571b7dea4a87ff8dec1731c86048a10fe1
parent150d2eec3812b44f303ce0b5d1ff9eda7c80d853
selftests: firmware: Fix it to do root uid check and skip

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>
tools/testing/selftests/firmware/fw_lib.sh