summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>2025-01-31 10:21:42 +0300
committerAlexei Starovoitov <ast@kernel.org>2025-02-03 14:33:51 +0300
commit0f5bab8dffc4e38454e13f228e2c5eed01cc319b (patch)
treeee2cc61766295f87eebb7742e85d33710e313fbc /tools/testing/selftests/bpf/prog_tests
parent6d34f5b728eb28e4f5acb00dc147507fea2e510c (diff)
downloadlinux-0f5bab8dffc4e38454e13f228e2c5eed01cc319b.tar.xz
selftests/bpf: test_xdp_veth: Remove unecessarry check_ping()
check_ping() directly returns a SYS_NOFAIL without any previous treatment. It's called only once in the file and hardcodes the used namespace and ip address. Replace check_ping() with a direct call of SYS_NOFAIL in the test. Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20250131-redirect-multi-v4-3-970b33678512@bootlin.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c b/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c
index 95e1791ea7e0..d41884fdc430 100644
--- a/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c
+++ b/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c
@@ -170,15 +170,6 @@ static void cleanup_network(void)
SYS_NOFAIL("ip netns del %s", config[i].namespace);
}
-static int check_ping(struct skeletons *skeletons)
-{
- /* Test: if all interfaces are properly configured, we must be able to ping
- * veth33 from veth11
- */
- return SYS_NOFAIL("ip netns exec %s ping -c 1 -W 1 %s > /dev/null",
- config[0].namespace, IP_DST);
-}
-
void test_xdp_veth_redirect(void)
{
struct skeletons skeletons = {};
@@ -198,7 +189,11 @@ void test_xdp_veth_redirect(void)
if (configure_network(&skeletons))
goto destroy_xdp_redirect_map;
- ASSERT_OK(check_ping(&skeletons), "ping");
+ /* Test: if all interfaces are properly configured, we must be able to ping
+ * veth33 from veth11
+ */
+ ASSERT_OK(SYS_NOFAIL("ip netns exec %s ping -c 1 -W 1 %s > /dev/null",
+ config[0].namespace, IP_DST), "ping");
destroy_xdp_redirect_map:
xdp_redirect_map__destroy(skeletons.xdp_redirect_maps);