Skip to content

Commit 44e8963

Browse files
netoptimizergregkh
authored andcommitted
selftests/bpf: test_progs use another shell exit on non-actions
[ Upstream commit 3220fb6 ] This is a follow up adjustment to commit 6c92bd5 ("selftests/bpf: Test_progs indicate to shell on non-actions"), that returns shell exit indication EXIT_FAILURE (value 1) when user selects a non-existing test. The problem with using EXIT_FAILURE is that a shell script cannot tell the difference between a non-existing test and the test failing. This patch uses value 2 as shell exit indication. (Aside note unrecognized option parameters use value 64). Fixes: 6c92bd5 ("selftests/bpf: Test_progs indicate to shell on non-actions") Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/159410593992.1093222.90072558386094370.stgit@firesoul Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 56129e4 commit 44e8963

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tools/testing/selftests/bpf/test_progs.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <string.h>
1313
#include <execinfo.h> /* backtrace */
1414

15+
#define EXIT_NO_TEST 2
16+
1517
/* defined in test_progs.h */
1618
struct test_env env = {};
1719

@@ -796,7 +798,7 @@ int main(int argc, char **argv)
796798
close(env.saved_netns_fd);
797799

798800
if (env.succ_cnt + env.fail_cnt + env.skip_cnt == 0)
799-
return EXIT_FAILURE;
801+
return EXIT_NO_TEST;
800802

801803
return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
802804
}

0 commit comments

Comments
 (0)