summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/tc_redirect.c
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2021-08-04 23:55:24 +0300
committerAndrii Nakryiko <andrii@kernel.org>2021-08-05 02:18:48 +0300
commit372642ea83ff1c71a5d567a704c912359eb59776 (patch)
tree2c14635ce0f301b5000866d151e277400fc1e5c7 /tools/testing/selftests/bpf/prog_tests/tc_redirect.c
parent34ad6d9d8c27293e1895b448af7d6cf5d351ad8d (diff)
downloadlinux-372642ea83ff1c71a5d567a704c912359eb59776.tar.xz
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
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tc_redirect.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/tc_redirect.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/tc_redirect.c b/tools/testing/selftests/bpf/prog_tests/tc_redirect.c
index 932e4ee3f97c..e7201ba29ccd 100644
--- a/tools/testing/selftests/bpf/prog_tests/tc_redirect.c
+++ b/tools/testing/selftests/bpf/prog_tests/tc_redirect.c
@@ -390,18 +390,6 @@ done:
close(client_fd);
}
-static char *ping_command(int family)
-{
- if (family == AF_INET6) {
- /* On some systems 'ping' doesn't support IPv6, so use ping6 if it is present. */
- if (!system("which ping6 >/dev/null 2>&1"))
- return "ping6";
- else
- return "ping -6";
- }
- return "ping";
-}
-
static int test_ping(int family, const char *addr)
{
SYS("ip netns exec " NS_SRC " %s " PING_ARGS " %s > /dev/null", ping_command(family), addr);