Skip to content

Commit 5c8fc19

Browse files
liuhangbinNobody
authored andcommitted
selftests/bpf/test_lirc_mode2.sh: exit with proper code
When test_lirc_mode2_user exec failed, the test report failed but still exit with 0. Fix it by exiting with an error code. Another issue is for the LIRCDEV checking. With bash -n, we need to quote the variable, or it will always be true. So if test_lirc_mode2_user was not run, just exit with skip code. Fixes: 6bdd533 ("bpf: add selftest for lirc_mode2 type program") Signed-off-by: Hangbin Liu <[email protected]>
1 parent dcaba9c commit 5c8fc19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/testing/selftests/bpf/test_lirc_mode2.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Kselftest framework requirement - SKIP code is 4.
55
ksft_skip=4
6+
ret=$ksft_skip
67

78
msg="skip all tests:"
89
if [ $UID != 0 ]; then
@@ -25,7 +26,7 @@ do
2526
fi
2627
done
2728

28-
if [ -n $LIRCDEV ];
29+
if [ -n "$LIRCDEV" ];
2930
then
3031
TYPE=lirc_mode2
3132
./test_lirc_mode2_user $LIRCDEV $INPUTDEV
@@ -36,3 +37,5 @@ then
3637
echo -e ${GREEN}"PASS: $TYPE"${NC}
3738
fi
3839
fi
40+
41+
exit $ret

0 commit comments

Comments
 (0)