summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-10-09 11:46:37 +0200
committerPhil Sutter <phil@nwl.cc>2025-04-10 18:45:46 +0200
commitfdb541cddad0681ea3ab1fca8a3949dcf49fb194 (patch)
tree06e5a130b9db96cdbd0cf5a2e4d6dca450a2240f
parent7746fa0b1619e1bd8465c9a98bdbead628ed428a (diff)
tests: iptables-test: Add nft-compat variant
Test iptables-nft with forced compat extension restore as third modus operandi. Signed-off-by: Phil Sutter <phil@nwl.cc>
-rwxr-xr-xiptables-test.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/iptables-test.py b/iptables-test.py
index 66db5521..be47a653 100755
--- a/iptables-test.py
+++ b/iptables-test.py
@@ -613,6 +613,8 @@ def main():
help='Check for missing tests')
parser.add_argument('-n', '--nftables', action='store_true',
help='Test iptables-over-nftables')
+ parser.add_argument('--compat', action='store_true',
+ help='Test iptables-over-nftables in forced compat mode')
parser.add_argument('-N', '--netns', action='store_const',
const='____iptables-container-test',
help='Test netnamespace path')
@@ -632,8 +634,10 @@ def main():
variants.append("legacy")
if args.nftables:
variants.append("nft")
+ if args.compat:
+ variants.append("nft-compat")
if len(variants) == 0:
- variants = [ "legacy", "nft" ]
+ variants = [ "legacy", "nft", "nft-compat" ]
if os.getuid() != 0:
print("You need to be root to run this, sorry", file=sys.stderr)
@@ -652,8 +656,14 @@ def main():
total_passed = 0
total_tests = 0
for variant in variants:
+
+ exec_infix = variant
+ if variant == "nft-compat":
+ os.putenv("XTABLES_COMPAT", "2")
+ exec_infix = "nft"
+
global EXECUTABLE
- EXECUTABLE = "xtables-" + variant + "-multi"
+ EXECUTABLE = "xtables-" + exec_infix + "-multi"
test_files = 0
tests = 0