selftests/bpf: add BPF object loading tests with explicit token passing
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 13 Dec 2023 19:08:39 +0000 (11:08 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 13 Dec 2023 23:47:05 +0000 (15:47 -0800)
commit98e0eaa36adfb580a3aa43fca62847ec0f625d3f
tree5224619e77c256f19d73feee7155c5cbc851c6f8
parent1d0dd6ea2e38c18e1b31a8c3c59b6bdfe4f4efde
selftests/bpf: add BPF object loading tests with explicit token passing

Add a few tests that attempt to load BPF object containing privileged
map, program, and the one requiring mandatory BTF uploading into the
kernel (to validate token FD propagation to BPF_BTF_LOAD command).

Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231213190842.3844987-8-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/token.c
tools/testing/selftests/bpf/progs/priv_map.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/priv_prog.c [new file with mode: 0644]