diff mbox series

[bpf] selftests/bpf: exit with error code if test failed

Message ID 20220317071805.43121-1-liuhangbin@gmail.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series [bpf] selftests/bpf: exit with error code if test failed | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: yhs@fb.com; 9 maintainers not CCed: songliubraving@fb.com linux-kselftest@vger.kernel.org andrii@kernel.org shuah@kernel.org yhs@fb.com john.fastabend@gmail.com kafai@fb.com kpsingh@kernel.org bpf@vger.kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 5 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf success VM_Test
bpf/vmtest-bpf-PR success PR summary

Commit Message

Hangbin Liu March 17, 2022, 7:18 a.m. UTC
The test_lirc_mode2.sh test exit with 0 even test failed. Fix it by
exiting with an error code.

Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/bpf/test_lirc_mode2.sh | 2 ++
 1 file changed, 2 insertions(+)

Comments

Daniel Borkmann March 18, 2022, 3:05 p.m. UTC | #1
On 3/17/22 8:18 AM, Hangbin Liu wrote:
> The test_lirc_mode2.sh test exit with 0 even test failed. Fix it by
> exiting with an error code.
> 
> Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>   tools/testing/selftests/bpf/test_lirc_mode2.sh | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/test_lirc_mode2.sh b/tools/testing/selftests/bpf/test_lirc_mode2.sh
> index ec4e15948e40..420dc86362f5 100755
> --- a/tools/testing/selftests/bpf/test_lirc_mode2.sh
> +++ b/tools/testing/selftests/bpf/test_lirc_mode2.sh
> @@ -36,3 +36,5 @@ then
>   		echo -e ${GREEN}"PASS: $TYPE"${NC}
>   	fi
>   fi
> +
> +exit $ret

nit: Shouldn't this also exit with error if no test_lirc_mode2_user was run?
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_lirc_mode2.sh b/tools/testing/selftests/bpf/test_lirc_mode2.sh
index ec4e15948e40..420dc86362f5 100755
--- a/tools/testing/selftests/bpf/test_lirc_mode2.sh
+++ b/tools/testing/selftests/bpf/test_lirc_mode2.sh
@@ -36,3 +36,5 @@  then
 		echo -e ${GREEN}"PASS: $TYPE"${NC}
 	fi
 fi
+
+exit $ret