]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
selftests/bpf: Make sock configurable for each test case
authorJordan Rife <jrife@google.com>
Mon, 29 Apr 2024 21:45:22 +0000 (16:45 -0500)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 2 May 2024 22:23:31 +0000 (15:23 -0700)
commit524e05ac4e14bb50b4f442e1fe88540abc9b72fd
tree765072b222024b6ccc7e4569d273de808bfa1195
parent8a9d22b8aeb2182cfe83991f11a88b3351084d3e
selftests/bpf: Make sock configurable for each test case

In order to reuse the same test code for both socket system calls (e.g.
connect(), bind(), etc.) and kernel socket functions (e.g.
kernel_connect(), kernel_bind(), etc.), this patch introduces the "ops"
field to sock_addr_test. This field allows each test cases to configure
the set of functions used in the test case to create, manipulate, and
tear down a socket.

Signed-off-by: Jordan Rife <jrife@google.com>
Link: https://lore.kernel.org/r/20240429214529.2644801-6-jrife@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/sock_addr.c