selftests/bpf: migrate cgroup sock create test for setting iface/mark/prio
This patch migrates the old test for cgroup BPF that sets sk_bound_dev_if, mark, and priority when AF_INET{6} sockets are created. The most closely related tests under selftests are 'test_sock' and 'sockopt'. However, these existing tests serve different purposes. 'test_sock' focuses mainly on verifying the socket binding process, while 'sockopt' concentrates on testing the behavior of getsockopt and setsockopt operations for various socket options. Neither of these existing tests directly covers the ability of cgroup BPF to set socket attributes such as sk_bound_dev_if, mark, and priority during socket creation. To address this gap, this patch introduces a migration of the old cgroup socket attribute test, now included as the 'sock_create' test in selftests/bpf. This ensures that the ability to configure these attributes during socket creation is properly tested. Signed-off-by:Daniel T. Lee <danieltimlee@gmail.com> Link: https://lore.kernel.org/r/20241011044847.51584-2-danieltimlee@gmail.com Signed-off-by:
Alexei Starovoitov <ast@kernel.org>
Showing
- samples/bpf/Makefile 0 additions, 2 deletionssamples/bpf/Makefile
- samples/bpf/test_cgrp2_sock.c 0 additions, 296 deletionssamples/bpf/test_cgrp2_sock.c
- samples/bpf/test_cgrp2_sock.sh 0 additions, 137 deletionssamples/bpf/test_cgrp2_sock.sh
- tools/testing/selftests/bpf/prog_tests/sock_create.c 256 additions, 0 deletionstools/testing/selftests/bpf/prog_tests/sock_create.c
samples/bpf/test_cgrp2_sock.c
deleted
100644 → 0
samples/bpf/test_cgrp2_sock.sh
deleted
100755 → 0
Please register or sign in to comment