selftests/bpf: Handle LOAD_REJECT test cases
authorJordan Rife <jrife@google.com>
Fri, 10 May 2024 19:02:20 +0000 (14:02 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 13 May 2024 00:10:41 +0000 (17:10 -0700)
commit5eff48f33fb733de9b88a5381e0428f3e873c670
treed83fbefb3068454dfc046b54263ea10fefc3bcc6
parent86b65c6db0190fb6c119e83da4de0eccf74fb1ff
selftests/bpf: Handle LOAD_REJECT test cases

In preparation to move test cases from bpf/test_sock_addr.c that expect
LOAD_REJECT, this patch adds expected_attach_type and extends load_fn to
accept an expected attach type and a flag indicating whether or not
rejection is expected.

Signed-off-by: Jordan Rife <jrife@google.com>
Link: https://lore.kernel.org/r/20240510190246.3247730-4-jrife@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/sock_addr.c