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)
commit463c2149ede72b696c42b0d6c5a03c061600d04c
treed42fb7d4a35e1b07541f349815cae123130c7df8
parent441e8c66b23e027c00ccebd70df9fd933918eefe
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