Merge tag 'xfs-5.8-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-2.6-microblaze.git] / tools / testing / selftests / ir / ir_loopback.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3
4 # Kselftest framework requirement - SKIP code is 4.
5 ksft_skip=4
6
7 if [ $UID != 0 ]; then
8         echo "Please run ir_loopback test as root [SKIP]"
9         exit $ksft_skip
10 fi
11
12 if ! /sbin/modprobe -q -n rc-loopback; then
13         echo "ir_loopback: module rc-loopback is not found [SKIP]"
14         exit $ksft_skip
15 fi
16
17 /sbin/modprobe rc-loopback
18 if [ $? -ne 0 ]; then
19         exit
20 fi
21
22 RCDEV=$(grep -l DRV_NAME=rc-loopback /sys/class/rc/rc*/uevent | grep -o 'rc[0-9]\+')
23
24 ./ir_loopback $RCDEV $RCDEV
25 exit