selftests/bpf: Integrate the socket_cookie test to test_progs
authorFlorent Revest <revest@chromium.org>
Wed, 10 Feb 2021 11:14:04 +0000 (12:14 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 12 Feb 2021 01:44:41 +0000 (17:44 -0800)
commit61f8c9c8f3c8fb60722f0f3168d1a546dbf8a3d4
tree20e462cfca537597fb3e360747d723bc359889f9
parentc5dbb89fc2ac013afe67b9e4fcb3743c02b567cd
selftests/bpf: Integrate the socket_cookie test to test_progs

Currently, the selftest for the BPF socket_cookie helpers is built and
run independently from test_progs. It's easy to forget and hard to
maintain.

This patch moves the socket cookies test into prog_tests/ and vastly
simplifies its logic by:
- rewriting the loading code with BPF skeletons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs

Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: KP Singh <kpsingh@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210210111406.785541-3-revest@chromium.org
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/socket_cookie.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/socket_cookie_prog.c
tools/testing/selftests/bpf/test_socket_cookie.c [deleted file]