selftests/bpf: Add test case for different expected_attach_type
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 26 Sep 2025 17:12:01 +0000 (19:12 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 27 Sep 2025 13:24:27 +0000 (06:24 -0700)
commit0e8e60e86cf3292e747a0fa7cc13127f290323ad
tree38273a6aedb140bcfa81a428e8cc67d25b136821
parent4540aed51b12bc13364149bf95f6ecef013197c0
selftests/bpf: Add test case for different expected_attach_type

Add a small test case which adds two programs - one calling the other
through a tailcall - and check that BPF rejects them in case of different
expected_attach_type values:

  # ./vmtest.sh -- ./test_progs -t xdp_devmap
  [...]
  #641/1   xdp_devmap_attach/DEVMAP with programs in entries:OK
  #641/2   xdp_devmap_attach/DEVMAP with frags programs in entries:OK
  #641/3   xdp_devmap_attach/Verifier check of DEVMAP programs:OK
  #641/4   xdp_devmap_attach/DEVMAP with programs in entries on veth:OK
  #641     xdp_devmap_attach:OK
  Summary: 2/4 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20250926171201.188490-2-daniel@iogearbox.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
tools/testing/selftests/bpf/progs/test_xdp_devmap_tailcall.c [new file with mode: 0644]