summaryrefslogtreecommitdiffstats
path: root/iptables-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'iptables-test.py')
-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