diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2020-07-02 00:44:07 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-02 01:22:13 +0300 |
commit | 6c92bd5cd4650c39dd929565ee172984c680fead (patch) | |
tree | 3c5b7fb035f4fcdf4389d46bf4c1bd6f0c625e8b /tools | |
parent | 17bbf925c6f86be8c08bc473cb5327c173154596 (diff) | |
download | linux-6c92bd5cd4650c39dd929565ee172984c680fead.tar.xz |
selftests/bpf: Test_progs indicate to shell on non-actions
When a user selects a non-existing test the summary is printed with
indication 0 for all info types, and shell "success" (EXIT_SUCCESS) is
indicated. This can be understood by a human end-user, but for shell
scripting is it useful to indicate a shell failure (EXIT_FAILURE).
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159363984736.930467.17956007131403952343.stgit@firesoul
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/test_progs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 54fa5fa688ce..da70a4f72f54 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -687,5 +687,8 @@ int main(int argc, char **argv) free_str_set(&env.subtest_selector.whitelist); free(env.subtest_selector.num_set); + if (env.succ_cnt + env.fail_cnt + env.skip_cnt == 0) + return EXIT_FAILURE; + return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS; } |