path: root/tools/testing/selftests/tc-testing/tdc_helper.py
diff options
authorBrenda J. Butler <bjb@mojatatu.com>2018-02-14 14:09:19 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-15 15:38:33 -0500
commitf87c7f646c6f704b29504d63c4ab965584c4aacb (patch)
tree679cdac7a53cf582ce75a4ade3791dc0a03804bd /tools/testing/selftests/tc-testing/tdc_helper.py
parentMerge branch 'tunchr-get-netns' (diff)
tools: tc-testing: Command line parms
Separate the functionality of the command line parameters into "selection" parameters, "action" parameters and other parameters. "Selection" parameters are for choosing which tests on which to act. "Action" parameters are for choosing what to do with the selected tests. "Other" parameters are for global effect (like "help" or "verbose"). With this commit, we add the ability to name a directory as another selection mechanism. We can accumulate a number of tests by directory, file, category, or even by test id, instead of being constrained to run all tests in one collection or just one test. Signed-off-by: Brenda J. Butler <bjb@mojatatu.com> Acked-by: Lucas Bates <lucasb@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/tc-testing/tdc_helper.py')
1 files changed, 3 insertions, 12 deletions
diff --git a/tools/testing/selftests/tc-testing/tdc_helper.py b/tools/testing/selftests/tc-testing/tdc_helper.py
index db381120a566..9f35c96c88a0 100644
--- a/tools/testing/selftests/tc-testing/tdc_helper.py
+++ b/tools/testing/selftests/tc-testing/tdc_helper.py
@@ -57,20 +57,11 @@ def print_sll(items):
def print_test_case(tcase):
""" Pretty-printing of a given test case. """
+ print('\n==============\nTest {}\t{}\n'.format(tcase['id'], tcase['name']))
for k in tcase.keys():
if (isinstance(tcase[k], list)):
print(k + ":")
- print(k + ": " + tcase[k])
-def show_test_case_by_id(testlist, caseID):
- """ Find the specified test case to pretty-print. """
- if not any(d.get('id', None) == caseID for d in testlist):
- print("That ID does not exist.")
- exit(1)
- else:
- print_test_case(next((d for d in testlist if d['id'] == caseID)))
+ if not ((k == 'id') or (k == 'name')):
+ print(k + ": " + str(tcase[k]))