• Home
  • Raw
  • Download

Lines Matching +full:self +full:- +full:test

2 # SPDX-License-Identifier: GPL-2.0
5 tdc.py - Linux tc (Traffic Control) unit test driver
29 def __init__(self, missing_pg): argument
30 self.missing_pg = missing_pg
33 def __init__(self, stage, output, message): argument
34 self.stage = stage
35 self.output = output
36 self.message = message
39 def __init__(self, argparser): argument
41 self.plugins = {}
42 self.plugin_instances = []
43 self.failed_plugins = {}
44 self.argparser = argparser
54 mn = fn[0:-3]
56 self.plugins[mn] = foo
57 self.plugin_instances.append(foo.SubPlugin())
59 def load_plugin(self, pgdir, pgname): argument
60 pgname = pgname[0:-3]
62 self.plugins[pgname] = foo
63 self.plugin_instances.append(foo.SubPlugin())
64 self.plugin_instances[-1].check_args(self.args, None)
66 def get_required_plugins(self, testlist): argument
68 Get all required plugins from the list of test cases and return
84 def load_required_plugins(self, reqs, parser, args, remaining): argument
86 Get all required plugins from the list of test cases and load any plugin
89 pgd = ['plugin-lib', 'plugin-lib-custom']
93 if r not in self.plugins:
109 self.load_plugin(pgdir, fname)
113 parser = self.call_add_args(parser)
117 def call_pre_suite(self, testcount, testidlist): argument
118 for pgn_inst in self.plugin_instances:
121 def call_post_suite(self, index): argument
122 for pgn_inst in reversed(self.plugin_instances):
125 def call_pre_case(self, caseinfo, *, test_skip=False): argument
126 for pgn_inst in self.plugin_instances:
136 def call_post_case(self): argument
137 for pgn_inst in reversed(self.plugin_instances):
140 def call_pre_execute(self): argument
141 for pgn_inst in self.plugin_instances:
144 def call_post_execute(self): argument
145 for pgn_inst in reversed(self.plugin_instances):
148 def call_add_args(self, parser): argument
149 for pgn_inst in self.plugin_instances:
153 def call_check_args(self, args, remaining): argument
154 for pgn_inst in self.plugin_instances:
157 def call_adjust_command(self, stage, command): argument
158 for pgn_inst in self.plugin_instances:
162 def set_args(self, args): argument
163 self.args = args
167 self.argparser = argparse.ArgumentParser(
202 foutput = serr.decode("utf-8", errors="ignore")
204 foutput = rawout.decode("utf-8", errors="ignore")
216 Execute the setup/teardown commands for a test case.
217 Optionally terminate test execution if the command fails.
242 print("\n{} *** Aborting test run.".format(prefix), file=sys.stderr)
267 …N value is an array, and it contains more elements than the command under test\'s output:\ncommand…
303 …N value is an array, and it contains more elements than the command under test\'s output:\ncommand…
361 print("Test " + tidx["id"] + ": " + tidx["name"])
367 res.set_errormsg('Test case designated as skipped.')
374 print('probe command for test skip')
380 res.set_errormsg('probe command: test skipped.')
385 # populate NAMES with TESTID for this test
389 prepare_env(args, pm, 'setup', "-----> prepare stage", tidx["setup"])
392 print('-----> execute stage')
411 print('-----> verify stage')
434 prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
448 teardown commands and the command under test itself. Also determines
449 success/failure based on the information in the test case and generates
472 stage = 'pre-SUITE'
478 print('give test rig 2 seconds to stabilize')
483 errmsg += "physical NIC with the -d option when running tdc.\n"
484 errmsg += "Test has been skipped."
509 print('Exception {} {} (caught in test_runner, running test {} {} {} stage {})'.
511 print('---------------')
514 print('---------------')
516 print('accumulated output for this test:')
519 print('---------------')
524 # fill in the remaining tests with ok-skipped
528 for tidx in testlist[count - 1:]:
531 msg = 'skipped - previous {} failed {} {}'.format(stage,
532 index, badtest.get('id', '--Unknown--'))
555 Open the JSON file containing the test cases and return them
562 print('IGNORING test case file {}\n\tBECAUSE: {}'.format(filename, jde))
585 '--outfile', type=str,
589 '-p', '--path', type=str,
592 'selection', 'select which test cases: ' +
595 'action', 'select action to perform on selected test cases')
598 '-D', '--directory', nargs='+', metavar='DIR',
600 '(default [tc-tests])')
602 '-f', '--file', nargs='+', metavar='FILE',
605 '-c', '--category', nargs='*', metavar='CATG', default=['+c'],
609 '-e', '--execute', nargs='+', metavar='ID',
610 help='Execute the specified test cases with specified IDs')
612 '-l', '--list', action='store_true',
613 help='List all test cases, or those only within the specified category')
615 '-s', '--show', action='store_true', dest='showID',
616 help='Display the selected test cases')
618 '-i', '--id', action='store_true', dest='gen_id',
619 help='Generate ID numbers for new test cases')
621 '-v', '--verbose', action='count', default=0,
624 '--format', default='tap', const='tap', nargs='?',
626 help='Specify the format for test results. (Default: TAP)')
627 parser.add_argument('-d', '--device',
628 help='Execute test cases that use a physical device, ' +
632 '-P', '--pause', action='store_true',
633 help='Pause execution just before post-suite stage')
660 Generate a list of all IDs in the test cases.
667 Check for duplicate test case IDs.
675 Check if a given ID already exists in the list of test cases.
683 If a test case has a blank ID field, generate a random hex ID for it
684 and then write the test cases back to disk.
748 If a test case file is specified, retrieve tests from that file.
757 testdirs = ['tc-tests']
760 # at least one file was specified - remove the default directory
809 Load the test case data and process remaining arguments to determine
819 print("No empty ID fields found in test files.")
824 print("The following test case IDs are not unique:")
855 print('Test results output suppression requested\n')
857 print('\nAll test results: \n')
867 fname = 'test-results.{}'.format(suffix)