diff options
author | Shuah Khan <shuah@kernel.org> | 2019-01-31 12:43:35 -0700 |
---|---|---|
committer | Shuah Khan <shuah@kernel.org> | 2019-02-13 09:10:47 -0700 |
commit | 6d771c60e50f89d017a74df62900ecd7ce65ab61 (patch) | |
tree | f7a85d96cd96072c340574fbc87fd4485be3e355 | |
parent | a5180977a3253a14aec5534fead920078ee98943 (diff) | |
download | linux-stable-6d771c60e50f89d017a74df62900ecd7ce65ab61.tar.gz linux-stable-6d771c60e50f89d017a74df62900ecd7ce65ab61.tar.bz2 linux-stable-6d771c60e50f89d017a74df62900ecd7ce65ab61.zip |
selftests: ir: skip when non-root user runs the test
Skip instead of fail when non-root user runs the test.
Signed-off-by: Shuah Khan <shuah@kernel.org>
Acked-by: Sean Young <sean@mess.org>
Signed-off-by: Shuah Khan <shuah@kernel.org>
-rwxr-xr-x | tools/testing/selftests/ir/ir_loopback.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/ir/ir_loopback.sh b/tools/testing/selftests/ir/ir_loopback.sh index 0a0b8dfa39be..b90dc9939f45 100755 --- a/tools/testing/selftests/ir/ir_loopback.sh +++ b/tools/testing/selftests/ir/ir_loopback.sh @@ -4,6 +4,11 @@ # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 +if [ $UID != 0 ]; then + echo "Please run ir_loopback test as root [SKIP]" + exit $ksft_skip +fi + if ! /sbin/modprobe -q -n rc-loopback; then echo "ir_loopback: module rc-loopback is not found [SKIP]" exit $ksft_skip |