Skip to contentSkip to conversation

selftests/bpf: Fix bpf_nf selftest failure

PATCH Applied Saket Kumar Bhaskar 2 participants 2 messages Apr 9, 2025

Subsystems (3)

v1 of 3 Applied 1/1 Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf: Fix bpf_nf selftest failure

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 de9c8d848d90 ("selftests/bpf: S/iptables/iptables-legacy/ in the bpf_nf and xdp_synproxy test")
---
 tools/testing/selftests/bpf/prog_tests/bpf_nf.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/bpf/prog_tests/bpf_nf.c +6 -0
index dbd13f8e42a7..dd6512fa652b 100644
@@ -63,6 +63,12 @@ static void test_bpf_nf_ct(int mode)
 		.repeat = 1,
 	);
 
+	if (SYS_NOFAIL("iptables-legacy --version")) {
+		fprintf(stdout, "Missing required iptables-legacy tool\n");
+		test__skip();
+		return;
+	}
+
 	skel = test_bpf_nf__open_and_load();
 	if (!ASSERT_OK_PTR(skel, "test_bpf_nf__open_and_load"))
 		return;
Signature · 1 line
2.43.5
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 9 lines · On Wed, 9 Apr 2025 15:26:33 +0530 you wrote:

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 de9c8d848d90 ("selftests/bpf: S/iptables/iptables-legacy/ in the bpf_nf and xdp_synproxy test")

[...]

Here is the summary with links:
- selftests/bpf: Fix bpf_nf selftest failure

    https://git.kernel.org/bpf/bpf-next/c/967e8def1100

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html