selftests/bpf: Add test for libbpf_bpf_prog_type_str
authorDaniel Müller <deso@posteo.net>
Mon, 23 May 2022 23:04:18 +0000 (23:04 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Jun 2022 23:26:15 +0000 (16:26 -0700)
commit8c5d71d96379e80c7c0d0fa7186c04f4deb04f16
tree601a9c0f0176d9718e7499d682564f89a0b5f47a
parentd18616e7aa940414312d63de918ab2204d82a20e
selftests/bpf: Add test for libbpf_bpf_prog_type_str

This change adds a test for libbpf_bpf_prog_type_str. The test retrieves
all variants of the bpf_prog_type enumeration using BTF and makes sure
that the function under test works as expected for them.

Signed-off-by: Daniel Müller <deso@posteo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220523230428.3077108-3-deso@posteo.net
tools/testing/selftests/bpf/prog_tests/libbpf_str.c [new file with mode: 0644]