]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb03e193184ce10bc9e3a6963947229789f74ec6f
treebc66bc67426d8b6b4b35b8975a97520badf712c7
parent4753960489159ab9dc778c0cfae62897858a4274
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]