summaryrefslogtreecommitdiffstats
path: root/iptables-test.py
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-11-05 16:12:11 +0100
committerPhil Sutter <phil@nwl.cc>2024-11-05 23:58:03 +0100
commit406ff3c3db9475ddf9cf4eb6854d79ca567a98fd (patch)
tree03907f7936ebfc4bbc4c8b93b3755638234dbb1e /iptables-test.py
parent6fbd211b48648a337d794ac1e1665d6ed3175a78 (diff)
tests: iptables-test: Extend fast mode docs a bit
To make things less confusing for new readers, describe at least what the two significant functions do. Fixes: 0e80cfea3762b ("tests: iptables-test: Implement fast test mode") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables-test.py')
-rwxr-xr-xiptables-test.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/iptables-test.py b/iptables-test.py
index 413e3fdc..141fec7b 100755
--- a/iptables-test.py
+++ b/iptables-test.py
@@ -241,10 +241,14 @@ def variant_res(res, variant, alt_res=None):
def fast_run_possible(filename):
'''
- Keep things simple, run only for simple test files:
+ Return true if fast test run is possible.
+
+ To keep things simple, run only for simple test files:
- no external commands
- no multiple tables
- no variant-specific results
+
+ :param filename: test file to inspect
'''
table = None
rulecount = 0
@@ -267,6 +271,9 @@ def run_test_file_fast(iptables, filename, netns):
'''
Run a test file, but fast
+ Add all non-failing rules at once by use of iptables-restore, then check
+ all rules' listing at once by use of iptables-save.
+
:param filename: name of the file with the test rules
:param netns: network namespace to perform test run in
'''