Linux Netfilter development
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Subject: [iptables PATCH 2/2] tests: iptables-test: Extend fast mode docs a bit
Date: Tue,  5 Nov 2024 21:36:11 +0100	[thread overview]
Message-ID: <20241105203611.11182-2-phil@nwl.cc> (raw)
In-Reply-To: <20241105203611.11182-1-phil@nwl.cc>

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 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/iptables-test.py b/iptables-test.py
index 413e3fdccc9e3..141fec7b4ed16 100755
--- a/iptables-test.py
+++ b/iptables-test.py
@@ -241,10 +241,14 @@ STDERR_IS_TTY = sys.stderr.isatty()
 
 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 @@ STDERR_IS_TTY = sys.stderr.isatty()
     '''
     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
     '''
-- 
2.47.0


  reply	other threads:[~2024-11-05 20:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 20:36 [iptables PATCH 1/2] tests: iptables-test: Properly assert rule deletion errors Phil Sutter
2024-11-05 20:36 ` Phil Sutter [this message]
2024-11-05 23:03 ` Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241105203611.11182-2-phil@nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox