selftests/bpf: Verify that the cgroup_skb filters receive expected packets.
authorKui-Feng Lee <thinker.li@gmail.com>
Sat, 24 Jun 2023 01:46:00 +0000 (18:46 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 30 Jun 2023 14:09:27 +0000 (16:09 +0200)
commit539c7e67aa4a170eea9a401464ec72a18a795a30
tree495adb20014b9ddafef1f27fe5029d614e035ac9
parent223f5f79f2ce8facd9d77dd44e9f403343630bfc
selftests/bpf: Verify that the cgroup_skb filters receive expected packets.

This test case includes four scenarios:

1. Connect to the server from outside the cgroup and close the connection
   from outside the cgroup.
2. Connect to the server from outside the cgroup and close the connection
   from inside the cgroup.
3. Connect to the server from inside the cgroup and close the connection
   from outside the cgroup.
4. Connect to the server from inside the cgroup and close the connection
   from inside the cgroup.

The test case is to verify that cgroup_skb/{egress, ingress} filters
receive expected packets including SYN, SYN/ACK, ACK, FIN, and FIN/ACK.

Signed-off-by: Kui-Feng Lee <kuifeng@meta.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230624014600.576756-3-kuifeng@meta.com
tools/testing/selftests/bpf/cgroup_helpers.c
tools/testing/selftests/bpf/cgroup_helpers.h
tools/testing/selftests/bpf/cgroup_tcp_skb.h [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/cgroup_tcp_skb.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/cgroup_tcp_skb.c [new file with mode: 0644]