selftests/bpf: add freplace of BTF-unreliable main prog test
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 15 Dec 2023 01:13:34 +0000 (17:13 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 20 Dec 2023 02:06:47 +0000 (18:06 -0800)
commitf0a5056222f2cfa6d40b4c888cb6b01e8569e282
tree48f3b6ea5e3a22eed329e643098b62564b85e910
parent0a0ffcac92d5b41133c97d260ad1f320572783a5
selftests/bpf: add freplace of BTF-unreliable main prog test

Add a test validating that freplace'ing another main (entry) BPF program
fails if the target BPF program doesn't have valid/expected func proto BTF.

We extend fexit_bpf2bpf test to allow to specify expected log message
for negative test cases (where freplace program is expected to fail to
load).

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231215011334.2307144-11-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
tools/testing/selftests/bpf/prog_tests/verifier.c
tools/testing/selftests/bpf/progs/freplace_unreliable_prog.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/verifier_btf_unreliable_prog.c [new file with mode: 0644]