Skip to content

Commit c076fd5

Browse files
TropicaoMartin KaFai Lau
authored andcommitted
selftests/bpf: Skip tc_tunnel subtest if its setup fails
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) <alexis.lothore@bootlin.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://patch.msgid.link/20251031-tc_tunnel_improv-v1-1-0ffe44d27eda@bootlin.com
1 parent ab01bfa commit c076fd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ void test_tc_tunnel(void)
666666
ret = build_subtest_name(cfg, cfg->name, TEST_NAME_MAX_LEN);
667667
if (ret < 0 || !test__start_subtest(cfg->name))
668668
continue;
669-
subtest_setup(skel, cfg);
670-
run_test(cfg);
669+
if (subtest_setup(skel, cfg) == 0)
670+
run_test(cfg);
671671
subtest_cleanup(cfg);
672672
}
673673
cleanup();

0 commit comments

Comments
 (0)