From: Vincent Whitchurch <vincent.whitchurch@xxxxxxxxxxxxx> If any tests failed, exit the program with a non-zero error code. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@xxxxxxxxxxxxx> --- tools/testing/selftests/bpf/test_sockmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 9cba4ec844a5..ab7e169f5afa 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -2079,7 +2079,9 @@ int main(int argc, char **argv) close(cg_fd); if (cg_created) cleanup_cgroup_environment(); - return err; + if (err) + return err; + return failed ? 1 : 0; } void running_handler(int a) -- 2.34.1