diff options
author | Sean Young <sean@mess.org> | 2018-05-27 14:24:10 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-30 13:40:14 +0300 |
commit | 6bdd533cee9aadbcd476af30bfff079abe68fcdb (patch) | |
tree | a153475f8949a8c9d6340b4f52c37b8912d0622d /tools/testing/selftests/bpf/test_lirc_mode2.sh | |
parent | f4364dcfc86df7c1ca47b256eaf6b6d0cdd0d936 (diff) | |
download | linux-6bdd533cee9aadbcd476af30bfff079abe68fcdb.tar.xz |
bpf: add selftest for lirc_mode2 type program
This is simple test over rc-loopback.
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_lirc_mode2.sh')
-rwxr-xr-x | tools/testing/selftests/bpf/test_lirc_mode2.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_lirc_mode2.sh b/tools/testing/selftests/bpf/test_lirc_mode2.sh new file mode 100755 index 000000000000..ce2e15e4f976 --- /dev/null +++ b/tools/testing/selftests/bpf/test_lirc_mode2.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +GREEN='\033[0;92m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +modprobe rc-loopback + +for i in /sys/class/rc/rc* +do + if grep -q DRV_NAME=rc-loopback $i/uevent + then + LIRCDEV=$(grep DEVNAME= $i/lirc*/uevent | sed sQDEVNAME=Q/dev/Q) + fi +done + +if [ -n $LIRCDEV ]; +then + TYPE=lirc_mode2 + ./test_lirc_mode2_user $LIRCDEV + ret=$? + if [ $ret -ne 0 ]; then + echo -e ${RED}"FAIL: $TYPE"${NC} + else + echo -e ${GREEN}"PASS: $TYPE"${NC} + fi +fi |