OSDN Git Service

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)
commit5a8ea82f9d25e88e502d1c3a1a9ba639f69a63c0
tree0d72e40888907ccbe7e5e4cb9be643d821646475
parent878d8def0603eebf11e19903e7a8886b3e9728e4
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]