OSDN Git Service

selftests/bpf: Move netcnt test under test_progs
authorStanislav Fomichev <sdf@google.com>
Wed, 4 Aug 2021 20:55:24 +0000 (13:55 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 4 Aug 2021 23:18:48 +0000 (16:18 -0700)
commit372642ea83ff1c71a5d567a704c912359eb59776
tree2c14635ce0f301b5000866d151e277400fc1e5c7
parent34ad6d9d8c27293e1895b448af7d6cf5d351ad8d
selftests/bpf: Move netcnt test under test_progs

Rewrite to skel and ASSERT macros as well while we are at it.

v3:
- replace -f with -A to make it work with busybox ping.
  -A is available on both busybox and iputils, from the man page:
  On networks with low RTT this mode is essentially equivalent to
  flood mode.

v2:
- don't check result of bpf_map__fd (Yonghong Song)
- remove from .gitignore (Andrii Nakryiko)
- move ping_command into network_helpers (Andrii Nakryiko)
- remove assert() (Andrii Nakryiko)

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210804205524.3748709-1-sdf@google.com
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/network_helpers.c
tools/testing/selftests/bpf/network_helpers.h
tools/testing/selftests/bpf/prog_tests/netcnt.c [new file with mode: 0644]
tools/testing/selftests/bpf/prog_tests/tc_redirect.c
tools/testing/selftests/bpf/test_netcnt.c [deleted file]