OSDN Git Service

selftests/bpf: Add test relying only on CO-RE and no recent kernel features
authorAndrii Nakryiko <andriin@fb.com>
Wed, 8 Jul 2020 01:53:16 +0000 (18:53 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 8 Jul 2020 22:44:45 +0000 (00:44 +0200)
commitfcda189a5133b6fe50eb63d1062a15be4df9e3de
treebc66bc67426d8b6b4b35b8975a97520badf712c7
parent0f0e55d8247c0742a9b026fc097fcc605383b9db
selftests/bpf: Add test relying only on CO-RE and no recent kernel features

Add a test that relies on CO-RE, but doesn't expect any of the recent
features, not available on old kernels. This is useful for Travis CI tests
running against very old kernels (e.g., libbpf has 4.9 kernel testing now), to
verify that CO-RE still works, even if kernel itself doesn't support BTF yet,
as long as there is .BTF embedded into vmlinux image by pahole. Given most of
CO-RE doesn't require any kernel awareness of BTF, it is a useful test to
validate that libbpf's BTF sanitization is working well even with ancient
kernels.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200708015318.3827358-5-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/core_retro.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/test_core_retro.c [new file with mode: 0644]