From 1b2f65bbe942ae3f662294bad5cbb839475db92e Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Wed, 24 Jun 2026 14:51:53 +0200 Subject: [PATCH] support/testing: TestIptables: check for netfilter legacy tables enabled TestIptables expect netfilter legacy tables enabled in the kernel. Make sure we use iptables-legacy: iptables --version iptables v1.8.11 (legacy) The test would fail if nftables compat (iptables-nft) is enabled. iptables --version iptables v1.8.11 (nf_tables) Add the following configuration fragment to enable iptables-nft: BR2_PACKAGE_IPTABLES_NFTABLES=y BR2_PACKAGE_IPTABLES_NFTABLES_DEFAULT=y Acked-by: Fiona Klute Tested-by: Fiona Klute Signed-off-by: Romain Naour Signed-off-by: Fiona Klute --- support/testing/tests/package/test_iptables.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support/testing/tests/package/test_iptables.py b/support/testing/tests/package/test_iptables.py index 72f2dd71a4..eeb4ccb5dd 100644 --- a/support/testing/tests/package/test_iptables.py +++ b/support/testing/tests/package/test_iptables.py @@ -38,7 +38,10 @@ class TestIptables(infra.basetest.BRTest): self.emulator.login() # We check the program can execute. - self.assertRunOk("iptables --version") + cmd = "iptables --version" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + self.assertTrue(output[0].endswith("(legacy)")) # We delete all rules in all chains. We also set default # policies to ACCEPT for INPUT and OUTPUT chains. This should