diff options
| author | Hangbin Liu <liuhangbin@gmail.com> | 2022-03-21 10:41:49 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-15 14:14:50 +0200 |
| commit | 3c8ddd0ff87a8f6c01c9e5c23ac542ea20159cd4 (patch) | |
| tree | 3a2db9e53582b1117a13851c782d373b8e12074b /tools/testing | |
| parent | 50da79f8891435b9c396787f35383174874d593b (diff) | |
selftests/bpf/test_lirc_mode2.sh: Exit with proper code
[ Upstream commit ec80906b0fbd7be11e3e960813b977b1ffe5f8fe ]
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: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220321024149.157861-1-liuhangbin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
| -rwxr-xr-x | tools/testing/selftests/bpf/test_lirc_mode2.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_lirc_mode2.sh b/tools/testing/selftests/bpf/test_lirc_mode2.sh index 677686198df3..795e56e3eaec 100755 --- a/tools/testing/selftests/bpf/test_lirc_mode2.sh +++ b/tools/testing/selftests/bpf/test_lirc_mode2.sh @@ -3,6 +3,7 @@ # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 +ret=$ksft_skip msg="skip all tests:" if [ $UID != 0 ]; then @@ -24,7 +25,7 @@ do fi done -if [ -n $LIRCDEV ]; +if [ -n "$LIRCDEV" ]; then TYPE=lirc_mode2 ./test_lirc_mode2_user $LIRCDEV @@ -35,3 +36,5 @@ then echo -e ${GREEN}"PASS: $TYPE"${NC} fi fi + +exit $ret |
