summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2020-07-07 09:12:19 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-21 13:05:31 +0200
commit8cab023c03aa4497b9cdb09bcb920166a48e0b8e (patch)
treecbad658aef1c039f1e3fe56cbfe840d599b9a03c /tools
parentde624fbac3eb3693d8c2f44abb12a123c7f605c9 (diff)
selftests/bpf: test_progs use another shell exit on non-actions
[ Upstream commit 3220fb667842a9725cbb71656f406eadb03c094b ] This is a follow up adjustment to commit 6c92bd5cd465 ("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: 6c92bd5cd465 ("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>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/test_progs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index a7d06724c18c..48bbe8e0ce48 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -7,6 +7,8 @@
#include <argp.h>
#include <string.h>
+#define EXIT_NO_TEST 2
+
/* defined in test_progs.h */
struct test_env env;
@@ -585,7 +587,7 @@ int main(int argc, char **argv)
free(env.subtest_selector.num_set);
if (env.succ_cnt + env.fail_cnt + env.skip_cnt == 0)
- return EXIT_FAILURE;
+ return EXIT_NO_TEST;
return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
}