Skip to contentSkip to conversation

iptables-test: Run tests in lexical order

PATCH In review Phil Sutter 2 participants 2 messages Sep 27, 2019 – Sep 30, 2019 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 iptables-test: Run tests in lexical order

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.

---
 iptables-test.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
iptables-test.py +6 -2
index 2aac8ef2256dc..fdb4e6a3644e4 100755
@@ -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:
Signature · 1 line
2.23.0