]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
tests: iptables-test: Extend fast mode docs a bit
authorPhil Sutter <phil@nwl.cc>
Tue, 5 Nov 2024 15:12:11 +0000 (16:12 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 5 Nov 2024 22:58:03 +0000 (23:58 +0100)
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>
iptables-test.py

index 413e3fdccc9e38ced3e5a760730eaa53557e3e1e..141fec7b4ed1605b580be86a6941e999155aa28f 100755 (executable)
@@ -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
     '''