]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add tests for target information in bpf_link info queries
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 13 Apr 2021 09:16:07 +0000 (11:16 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 14 Apr 2021 01:18:57 +0000 (18:18 -0700)
commit6f4f343edb4479a5a80abaae607c202fe900ad43
treed42fb7d4a35e1b07541f349815cae123130c7df8
parent0f079e64a73909fb02e367f7e46187587d174876
selftests/bpf: Add tests for target information in bpf_link info queries

Extend the fexit_bpf2bpf test to check that the info for the bpf_link
returned by the kernel matches the expected values.

While we're updating the test, change existing uses of CHEC() to use the
much easier to read ASSERT_*() macros.

v2:
- Convert last CHECK() call and get rid of 'duration' var
- Split ASSERT_OK_PTR() checks to two separate if statements

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210413091607.58945-2-toke@redhat.com
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c