summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-04-10 19:00:26 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-04-11 09:57:28 +0200
commitc7248b3df44ba67c3fad84a48837fe7205165657 (patch)
tree66d30bea115716e8bdfd1567c90a459c029d2500 /tests
parent820fd08b5f1d43053c5ecb54549a864a8083dd9d (diff)
tests/py: Allow passing multiple files to nft-test.py
This allows to run the testsuite over a subset of test cases, e.g. like so: | ./nft-test.py bridge/*.t Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/py/nft-test.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 8a82a80a..d5cb25b3 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -1078,8 +1078,8 @@ def run_test_file(filename, force_all_family_option, specific_file):
def main():
parser = argparse.ArgumentParser(description='Run nft tests', version='1.0')
- parser.add_argument('filename', nargs='?', metavar='path/to/file.t',
- help='Run only this test')
+ parser.add_argument('filenames', nargs='*', metavar='path/to/file.t',
+ help='Run only these tests')
parser.add_argument('-d', '--debug', action='store_true', dest='debug',
help='enable debugging mode')
@@ -1129,9 +1129,10 @@ def main():
return
file_list = []
- if args.filename:
- file_list = [args.filename]
- specific_file = True
+ if args.filenames:
+ file_list = args.filenames
+ if len(args.filenames) == 1:
+ specific_file = True
else:
for directory in TESTS_DIRECTORY:
path = os.path.join(TESTS_PATH, directory)