3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

auto-t: introduce new autotest syntax

Sometimes improperly written tests can end up causing future tests
to fail. For faster debugging you can now add a '+' after a given
autotest which will start that test and run all tests which come
alphabetically after it (as if you are running a full autotest suite).

Example:

./test-runner -A testWPA+

This will run testWPA, testWPA2, testWPA2-no-CCMP, testWPA2-SHA256,
and testWPA2withMFP.
This commit is contained in:
James Prestwood 2020-11-16 14:25:14 -08:00 committed by Denis Kenzior
parent 423f9a4e60
commit a6808aa55a

View File

@ -802,6 +802,7 @@ def build_test_list(args):
''' '''
tests = [] tests = []
test_root = args.testhome + '/autotests' test_root = args.testhome + '/autotests'
full_list = sorted(os.listdir(test_root))
# Run all tests # Run all tests
if not args.auto_tests: if not args.auto_tests:
@ -809,15 +810,19 @@ def build_test_list(args):
if args.shell: if args.shell:
return [test_root + '/shell'] return [test_root + '/shell']
tests = os.listdir(test_root)
# Pair down any non-tests and append full path # Pair down any non-tests and append full path
tests = [test_root + '/' + t for t in tests if t.startswith('test')] tests = [test_root + '/' + t for t in full_list if t.startswith('test')]
else: else:
print("Generating partial test list") print("Generating partial test list")
for t in args.auto_tests.split(','): for t in args.auto_tests.split(','):
path = '%s/%s' % (test_root, t) path = '%s/%s' % (test_root, t)
# Full test path specified if t.endswith('+'):
if os.path.exists(t): t = t.split('+')[0]
i = full_list.index(t)
tests = [test_root + '/' + x for x in full_list[i:] \
if x.startswith('test')]
elif os.path.exists(t):
tests.append(t) tests.append(t)
elif os.path.exists(path): elif os.path.exists(path):
tests.append(path) tests.append(path)