Skip to content

Commit f1b0b9b

Browse files
Saket Kumar Bhaskargregkh
authored andcommitted
selftests/bpf: Fix bpf_nf selftest failure
[ Upstream commit 967e8de ] For systems with missing iptables-legacy tool this selftest fails. Add check to find if iptables-legacy tool is available and skip the test if the tool is missing. Fixes: de9c8d8 ("selftests/bpf: S/iptables/iptables-legacy/ in the bpf_nf and xdp_synproxy test") Signed-off-by: Saket Kumar Bhaskar <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 671dd1f commit f1b0b9b

File tree

1 file changed

+6
-0
lines changed
  • tools/testing/selftests/bpf/prog_tests

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ static void test_bpf_nf_ct(int mode)
6363
.repeat = 1,
6464
);
6565

66+
if (SYS_NOFAIL("iptables-legacy --version")) {
67+
fprintf(stdout, "Missing required iptables-legacy tool\n");
68+
test__skip();
69+
return;
70+
}
71+
6672
skel = test_bpf_nf__open_and_load();
6773
if (!ASSERT_OK_PTR(skel, "test_bpf_nf__open_and_load"))
6874
return;

0 commit comments

Comments
 (0)