diff options
| author | Saket Kumar Bhaskar <[email protected]> | 2025-04-09 09:56:33 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2025-04-09 23:29:39 +0000 |
| commit | 967e8def1100cb4b08c28a54d27ce69563fdf281 (patch) | |
| tree | 0ed137f18ad5c073c0cd727349a1fdda085a17eb | |
| parent | bpf: Check link_create.flags parameter for multi_uprobe (diff) | |
| download | kernel-967e8def1100cb4b08c28a54d27ce69563fdf281.tar.gz kernel-967e8def1100cb4b08c28a54d27ce69563fdf281.zip | |
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")
Signed-off-by: Saket Kumar Bhaskar <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/bpf_nf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_nf.c b/tools/testing/selftests/bpf/prog_tests/bpf_nf.c index dbd13f8e42a7..dd6512fa652b 100644 --- a/tools/testing/selftests/bpf/prog_tests/bpf_nf.c +++ b/tools/testing/selftests/bpf/prog_tests/bpf_nf.c @@ -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; |
