selftests/bpf: Move test_tcppbf_user into test_progs
authorAlexander Duyck <alexanderduyck@fb.com>
Tue, 3 Nov 2020 21:34:48 +0000 (13:34 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 4 Nov 2020 01:52:37 +0000 (17:52 -0800)
commitaaf376bddf68d0afe5f4b5f25fc555da358e2287
treeb012f3ecef72cec3a326d8f28dfda929f3da1fdf
parent8aaeed81fcb917b5cf4976932c5baefa1471128b
selftests/bpf: Move test_tcppbf_user into test_progs

Recently a bug was missed due to the fact that test_tcpbpf_user is not a
part of test_progs. In order to prevent similar issues in the future move
the test functionality into test_progs. By doing this we can make certain
that it is a part of standard testing and will not be overlooked.

As a part of moving the functionality into test_progs it is necessary to
integrate with the test_progs framework and to drop any redundant code.
This patch:
1. Cleans up the include headers
2. Dropped a duplicate definition of bpf_find_map
3. Switched over to using test_progs specific cgroup functions
4. Renamed main to test_tcpbpf_user
5. Dropped return value in favor of CHECK_FAIL to check for errors

The general idea is that I wanted to keep the changes as small as possible
while moving the file into the test_progs framework. The follow-on patches
are meant to clean up the remaining issues such as the use of CHECK_FAIL.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/160443928881.1086697.17661359319919165370.stgit@localhost.localdomain
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/tcpbpf_user.c [moved from tools/testing/selftests/bpf/test_tcpbpf_user.c with 81% similarity]