test/runtests.sh: check for root before using /dev/kmsg
@@ -6,8 +6,17 @@ RET=0
TIMEOUT=30
FAILED=""
+do_kmsg="yes"
+if ! [ $(id -u) = 0 ]; then
+ do_kmsg="no"
+fi
+
for t in $TESTS; do
+ if [ "$do_kmsg" = "yes" ]; then
echo Running test $t | tee > /dev/kmsg
+ else
+ echo Running test $t
+ fi
timeout -s INT $TIMEOUT ./$t
r=$?
if [ "${r}" -eq 124 ]; then
