• 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:
135 def call_post_case(self): argument
136 for pgn_inst in reversed(self.plugin_instances):
139 def call_pre_execute(self): argument
140 for pgn_inst in self.plugin_instances:
143 def call_post_execute(self): argument
144 for pgn_inst in reversed(self.plugin_instances):
147 def call_add_args(self, parser): argument
148 for pgn_inst in self.plugin_instances:
152 def call_check_args(self, args, remaining): argument
153 for pgn_inst in self.plugin_instances:
156 def call_adjust_command(self, stage, command): argument
157 for pgn_inst in self.plugin_instances:
161 def set_args(self, args): argument
162 self.args = args
166 self.argparser = argparse.ArgumentParser(
201 foutput = serr.decode("utf-8", errors="ignore")
203 foutput = rawout.decode("utf-8", errors="ignore")
215 Execute the setup/teardown commands for a test case.
216 Optionally terminate test execution if the command fails.
241 print("\n{} *** Aborting test run.".format(prefix), file=sys.stderr)
266 …N value is an array, and it contains more elements than the command under test\'s output:\ncommand…
302 …N value is an array, and it contains more elements than the command under test\'s output:\ncommand…
360 print("Test " + tidx["id"] + ": " + tidx["name"])
366 res.set_errormsg('Test case designated as skipped.')
373 print('probe command for test skip')
379 res.set_errormsg('probe command: test skipped.')
384 # populate NAMES with TESTID for this test
388 prepare_env(args, pm, 'setup', "-----> prepare stage", tidx["setup"])
391 print('-----> execute stage')
410 print('-----> verify stage')
433 prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
447 teardown commands and the command under test itself. Also determines
448 success/failure based on the information in the test case and generates
471 stage = 'pre-SUITE'
477 print('give test rig 2 seconds to stabilize')
482 errmsg += "physical NIC with the -d option when running tdc.\n"
483 errmsg += "Test has been skipped."
508 print('Exception {} {} (caught in test_runner, running test {} {} {} stage {})'.
510 print('---------------')
513 print('---------------')
515 print('accumulated output for this test:')
518 print('---------------')
523 # fill in the remaining tests with ok-skipped
527 for tidx in testlist[count - 1:]:
530 msg = 'skipped - previous {} failed {} {}'.format(stage,
531 index, badtest.get('id', '--Unknown--'))
554 Open the JSON file containing the test cases and return them
561 print('IGNORING test case file {}\n\tBECAUSE: {}'.format(filename, jde))
584 '--outfile', type=str,
588 '-p', '--path', type=str,
591 'selection', 'select which test cases: ' +
594 'action', 'select action to perform on selected test cases')
597 '-D', '--directory', nargs='+', metavar='DIR',
599 '(default [tc-tests])')
601 '-f', '--file', nargs='+', metavar='FILE',
604 '-c', '--category', nargs='*', metavar='CATG', default=['+c'],
608 '-e', '--execute', nargs='+', metavar='ID',
609 help='Execute the specified test cases with specified IDs')
611 '-l', '--list', action='store_true',
612 help='List all test cases, or those only within the specified category')
614 '-s', '--show', action='store_true', dest='showID',
615 help='Display the selected test cases')
617 '-i', '--id', action='store_true', dest='gen_id',
618 help='Generate ID numbers for new test cases')
620 '-v', '--verbose', action='count', default=0,
623 '--format', default='tap', const='tap', nargs='?',
625 help='Specify the format for test results. (Default: TAP)')
626 parser.add_argument('-d', '--device',
627 help='Execute test cases that use a physical device, ' +
631 '-P', '--pause', action='store_true',
632 help='Pause execution just before post-suite stage')
659 Generate a list of all IDs in the test cases.
666 Check for duplicate test case IDs.
674 Check if a given ID already exists in the list of test cases.
682 If a test case has a blank ID field, generate a random hex ID for it
683 and then write the test cases back to disk.
747 If a test case file is specified, retrieve tests from that file.
756 testdirs = ['tc-tests']
759 # at least one file was specified - remove the default directory
808 Load the test case data and process remaining arguments to determine
818 print("No empty ID fields found in test files.")
823 print("The following test case IDs are not unique:")
854 print('Test results output suppression requested\n')
856 print('\nAll test results: \n')
866 fname = 'test-results.{}'.format(suffix)