summaryrefslogtreecommitdiffstats
path: root/iptables-test.py
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-09-27 12:07:46 +0200
committerPhil Sutter <phil@nwl.cc>2019-10-17 13:48:09 +0200
commit124587ad42cd7b83e3204b49f1f1e2a0b782c320 (patch)
tree7b313582da99d68e772244ebfaa49ec8aafa63a8 /iptables-test.py
parentd812b91bc6e010dcdd4ed039c3979a02fb57eb1c (diff)
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. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables-test.py')
-rwxr-xr-xiptables-test.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/iptables-test.py b/iptables-test.py
index 2aac8ef2..fdb4e6a3 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: