Skip to content

Commit fe4d303

Browse files
netoptimizergregkh
authored andcommitted
selftests/bpf: Test_progs indicate to shell on non-actions
[ Upstream commit 6c92bd5 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7869106 commit fe4d303

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,5 +776,8 @@ int main(int argc, char **argv)
776776
free_str_set(&env.subtest_selector.whitelist);
777777
free(env.subtest_selector.num_set);
778778

779+
if (env.succ_cnt + env.fail_cnt + env.skip_cnt == 0)
780+
return EXIT_FAILURE;
781+
779782
return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
780783
}

0 commit comments

Comments
 (0)