]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables-test: Run tests in lexical order
authorPhil Sutter <phil@nwl.cc>
Fri, 27 Sep 2019 10:07:46 +0000 (12:07 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 17 Oct 2019 11:48:09 +0000 (13:48 +0200)
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>
iptables-test.py

index 2aac8ef2256dc7b85c93bc4a4c0119d5f6a902bc..fdb4e6a3644e4743f22abbe6fc9f049c6493ece1 100755 (executable)
@@ -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: