Skip to content

Commit

Permalink
selftests/bpf: Test_progs indicate to shell on non-actions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/159363984736.930467.17956007131403952343.stgit@firesoul
  • Loading branch information
netoptimizer authored and Alexei Starovoitov committed Jul 1, 2020
1 parent 17bbf92 commit 6c92bd5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/testing/selftests/bpf/test_progs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 6c92bd5

Please sign in to comment.