]> 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)
commit504d2542b1c61c0025ea46d80fdbc7df24113537
tree0d72e40888907ccbe7e5e4cb9be643d821646475
parent890ae33d20d44354b053dd1560a39380b91ad211
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]