netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iptables PATCH] iptables-test: Run tests in lexical order
@ 2019-09-27 12:57 Phil Sutter
  2019-09-30 14:30 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2019-09-27 12:57 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

To quickly see if a given test was run or not, sort the file list. Also
filter non-test files right when preparing the list.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 iptables-test.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/iptables-test.py b/iptables-test.py
index 2aac8ef2256dc..fdb4e6a3644e4 100755
--- a/iptables-test.py
+++ b/iptables-test.py
@@ -359,10 +359,14 @@ def main():
         print("Couldn't open log file %s" % LOGFILE)
         return
 
-    file_list = [os.path.join(EXTENSIONS_PATH, i)
-                 for i in os.listdir(EXTENSIONS_PATH)]
     if args.filename:
         file_list = [args.filename]
+    else:
+        file_list = [os.path.join(EXTENSIONS_PATH, i)
+                     for i in os.listdir(EXTENSIONS_PATH)
+                     if i.endswith('.t')]
+        file_list.sort()
+
     for filename in file_list:
         file_tests, file_passed = run_test_file(filename, args.netns)
         if file_tests:
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [iptables PATCH] iptables-test: Run tests in lexical order
  2019-09-27 12:57 [iptables PATCH] iptables-test: Run tests in lexical order Phil Sutter
@ 2019-09-30 14:30 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2019-09-30 14:30 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netfilter-devel

On Fri, Sep 27, 2019 at 02:57:16PM +0200, Phil Sutter wrote:
> To quickly see if a given test was run or not, sort the file list. Also
> filter non-test files right when preparing the list.
> 
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-30 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 12:57 [iptables PATCH] iptables-test: Run tests in lexical order Phil Sutter
2019-09-30 14:30 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).