bpf: add selftest for tcpbpf
authorLawrence Brakmo <brakmo@fb.com>
Fri, 26 Jan 2018 00:14:16 +0000 (16:14 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Jan 2018 00:41:15 +0000 (16:41 -0800)
commitd6d4f60c3a0933852dcc40a2142d93027ea1da76
treea740942fab1902605fe48ed877d942c6ad02ad58
parentd44874910a26f3a8f81edf873a2473363f07f660
bpf: add selftest for tcpbpf

Added a selftest for tcpbpf (sock_ops) that checks that the appropriate
callbacks occured and that it can access tcp_sock fields and that their
values are correct.

Run with command: ./test_tcpbpf_user
Adding the flag "-d" will show why it did not pass.

Signed-off-by: Lawrence Brakmo <brakmo@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/include/uapi/linux/bpf.h
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/bpf_helpers.h
tools/testing/selftests/bpf/tcp_client.py [new file with mode: 0755]
tools/testing/selftests/bpf/tcp_server.py [new file with mode: 0755]
tools/testing/selftests/bpf/test_tcpbpf.h [new file with mode: 0644]
tools/testing/selftests/bpf/test_tcpbpf_kern.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_tcpbpf_user.c [new file with mode: 0644]