]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables-test.py: Accept multiple test files on commandline
authorPhil Sutter <phil@nwl.cc>
Tue, 17 Nov 2020 15:18:33 +0000 (16:18 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 17 Nov 2020 19:03:52 +0000 (20:03 +0100)
This allows to call the script like so:

| # ./iptables-test.py -n extensions/libebt_*.t

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables-test.py

index 6b6eb611a729002da3e2205a1470fb07e68cae32..52897a5d93ced322d8dd2021bffc482576caa540 100755 (executable)
@@ -310,7 +310,7 @@ def show_missing():
 #
 def main():
     parser = argparse.ArgumentParser(description='Run iptables tests')
-    parser.add_argument('filename', nargs='?',
+    parser.add_argument('filename', nargs='*',
                         metavar='path/to/file.t',
                         help='Run only this test')
     parser.add_argument('-H', '--host', action='store_true',
@@ -359,7 +359,7 @@ def main():
         return
 
     if args.filename:
-        file_list = [args.filename]
+        file_list = args.filename
     else:
         file_list = [os.path.join(EXTENSIONS_PATH, i)
                      for i in os.listdir(EXTENSIONS_PATH)