blob: b90dc9939f45d24f8c2a810941c2226f0f2997dc [file] [log] [blame]
Sean Younge55c8842018-10-16 15:09:31 +01001#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4# Kselftest framework requirement - SKIP code is 4.
5ksft_skip=4
6
Shuah Khan6d771c62019-01-31 12:43:35 -07007if [ $UID != 0 ]; then
8 echo "Please run ir_loopback test as root [SKIP]"
9 exit $ksft_skip
10fi
11
Sean Younge55c8842018-10-16 15:09:31 +010012if ! /sbin/modprobe -q -n rc-loopback; then
13 echo "ir_loopback: module rc-loopback is not found [SKIP]"
14 exit $ksft_skip
15fi
16
17/sbin/modprobe rc-loopback
18if [ $? -ne 0 ]; then
19 exit
20fi
21
22RCDEV=$(grep -l DRV_NAME=rc-loopback /sys/class/rc/rc*/uevent | grep -o 'rc[0-9]\+')
23
24./ir_loopback $RCDEV $RCDEV
25exit