From c076fd5bb4d70b1f9de7aaf6cc6165891f190ba9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Lothor=C3=A9=20=28eBPF=20Foundation=29?= Date: Fri, 31 Oct 2025 10:01:41 +0100 Subject: [PATCH] selftests/bpf: Skip tc_tunnel subtest if its setup fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A subtest setup can fail in a wide variety of ways, so make sure not to run it if an issue occurs during its setup. The return value is already representing whether the setup succeeds or fails, it is just about wiring it. Signed-off-by: Alexis Lothoré (eBPF Foundation) Signed-off-by: Martin KaFai Lau Link: https://patch.msgid.link/20251031-tc_tunnel_improv-v1-1-0ffe44d27eda@bootlin.com --- tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c index cf2e088bfe8ef..1d8d38e67f8bb 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c +++ b/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c @@ -666,8 +666,8 @@ void test_tc_tunnel(void) ret = build_subtest_name(cfg, cfg->name, TEST_NAME_MAX_LEN); if (ret < 0 || !test__start_subtest(cfg->name)) continue; - subtest_setup(skel, cfg); - run_test(cfg); + if (subtest_setup(skel, cfg) == 0) + run_test(cfg); subtest_cleanup(cfg); } cleanup(); -- 2.47.3