diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-08-22 02:44:25 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-08-28 01:35:40 +0300 |
commit | d38835b75f67df16cef65c14aa64796a1832e6b4 (patch) | |
tree | 2ec02d43503dcbcde612f61821e5baa1f8ae25b8 /tools/testing/selftests/bpf/prog_tests/flow_dissector.c | |
parent | cd9c21d76879a06216597052d3b45c51be977aaa (diff) | |
download | linux-d38835b75f67df16cef65c14aa64796a1832e6b4.tar.xz |
selftests/bpf: test_progs: remove global fail/success counts
Now that we have a global per-test/per-environment state, there
is no longer need to have global fail/success counters (and there
is no need to save/get the diff before/after the test).
Introduce CHECK_FAIL macro (suggested by Andrii) and covert existing tests
to it. CHECK_FAIL uses new test__fail() to record the failure.
Cc: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/flow_dissector.c')
-rw-r--r-- | tools/testing/selftests/bpf/prog_tests/flow_dissector.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c b/tools/testing/selftests/bpf/prog_tests/flow_dissector.c index 6892b88ae065..aee0cda7870b 100644 --- a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c +++ b/tools/testing/selftests/bpf/prog_tests/flow_dissector.c @@ -452,10 +452,8 @@ void test_flow_dissector(void) err = bpf_flow_load(&obj, "./bpf_flow.o", "flow_dissector", "jmp_table", "last_dissection", &prog_fd, &keys_fd); - if (err) { - error_cnt++; + if (CHECK_FAIL(err)) return; - } for (i = 0; i < ARRAY_SIZE(tests); i++) { struct bpf_flow_keys flow_keys; |