]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Add libbpf feature-probing API selftests
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 17 Dec 2021 17:12:01 +0000 (09:12 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 17 Dec 2021 22:11:13 +0000 (23:11 +0100)
commit7dc1e678b0755342934f8dc02af3bb1a1ac83510
tree0d72e40888907ccbe7e5e4cb9be643d821646475
parentbd57720bdea9928658be4df35fc03e735caafac9
selftests/bpf: Add libbpf feature-probing API selftests

Add selftests for prog/map/prog+helper feature probing APIs. Prog and
map selftests are designed in such a way that they will always test all
the possible prog/map types, based on running kernel's vmlinux BTF enum
definition. This way we'll always be sure that when adding new BPF
program types or map types, libbpf will be always updated accordingly to
be able to feature-detect them.

BPF prog_helper selftest will have to be manually extended with
interesting and important prog+helper combinations, it's easy, but can't
be completely automated.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Dave Marchevsky <davemarchevsky@fb.com>
Link: https://lore.kernel.org/bpf/20211217171202.3352835-3-andrii@kernel.org
tools/testing/selftests/bpf/config
tools/testing/selftests/bpf/prog_tests/libbpf_probes.c [new file with mode: 0644]