]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Add two selftests for mprog API based cgroup progs
authorYonghong Song <yonghong.song@linux.dev>
Fri, 6 Jun 2025 16:31:56 +0000 (09:31 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 9 Jun 2025 23:28:31 +0000 (16:28 -0700)
commite422d5f118e4da5d15b57c5721ee68ae39b512ec
treeee4f3bbbef0f5e95caa73394b6e6217b261234df
parentc1bb68656bc18fd59bbd630fd1b5a86875b464b3
selftests/bpf: Add two selftests for mprog API based cgroup progs

Two tests are added:
  - cgroup_mprog_opts, which mimics tc_opts.c ([1]). Both prog and link
    attach are tested. Some negative tests are also included.
  - cgroup_mprog_ordering, which actually runs the program with some mprog
    API flags.

  [1] https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/prog_tests/tc_opts.c

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250606163156.2429955-1-yonghong.song@linux.dev
tools/testing/selftests/bpf/prog_tests/cgroup_mprog_opts.c [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/cgroup_mprog_ordering.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/cgroup_mprog.c [new file with mode: 0644]