* [PATCH] selftests: ir: skip when non-root user runs the test
@ 2019-01-31 19:46 Shuah Khan
0 siblings, 0 replies; only message in thread
From: Shuah Khan @ 2019-01-31 19:46 UTC (permalink / raw)
To: shuah, sean; +Cc: linux-kselftest, linux-kernel
Skip instead of fail when non-root user runs the test.
Signed-off-by: Shuah Khan <shuah@kernel.org>
---
tools/testing/selftests/ir/ir_loopback.sh | 5 +++++
1 file changed, 5 insertions(+)
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
--
2.17.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-31 19:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 19:46 [PATCH] selftests: ir: skip when non-root user runs the test Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®