Lines Matching +full:proc +full:- +full:id
2 # SPDX-License-Identifier: GPL-2.0
5 tdc.py - Linux tc (Traffic Control) unit test driver
54 mn = fn[0:-3]
60 pgname = pgname[0:-3]
64 self.plugin_instances[-1].check_args(self.args, None)
89 pgd = ['plugin-lib', 'plugin-lib-custom']
133 print('testid is {}'.format(caseinfo['id']))
193 proc = subprocess.Popen(command,
200 (rawout, serr) = proc.communicate(timeout=NAMES['TIMEOUT'])
201 if proc.returncode != 0 and len(serr) > 0:
202 foutput = serr.decode("utf-8", errors="ignore")
204 foutput = rawout.decode("utf-8", errors="ignore")
207 proc.returncode = 255
209 proc.stdout.close()
210 proc.stderr.close()
211 return proc, foutput
232 (proc, foutput) = exec_cmd(args, pm, stage, cmd)
234 if proc and (proc.returncode not in exit_codes):
240 print("returncode {}; expected {}".format(proc.returncode,
243 print("\n\n{} *** stdout ***".format(proc.stdout), file=sys.stderr)
244 print("\n\n{} *** stderr ***".format(proc.stderr), file=sys.stderr)
254 res = TestResult(tidx['id'], tidx['name'])
257 print("Test " + tidx["id"] + ": " + tidx["name"])
261 res = TestResult(tidx['id'], tidx['name'])
269 NAMES['TESTID'] = tidx['id']
272 prepare_env(args, pm, 'setup', "-----> prepare stage", tidx["setup"])
275 print('-----> execute stage')
294 print('-----> verify stage')
311 prepare_env(args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
341 pm.call_pre_suite(tcount, [tidx['id'] for tidx in testlist])
349 stage = 'pre-SUITE'
360 errmsg += "physical NIC with the -d option when running tdc.\n"
364 res = TestResult(tidx['id'], tidx['name'])
378 res = TestResult(tidx['id'], tidx['name'])
386 format(ex_type, ex, index, tidx['id'], tidx['name'], stage))
387 print('---------------')
390 print('---------------')
395 print('---------------')
400 # fill in the remaining tests with ok-skipped
404 for tidx in testlist[count - 1:]:
405 res = TestResult(tidx['id'], tidx['name'])
407 msg = 'skipped - previous {} failed {} {}'.format(stage,
408 index, badtest.get('id', '--Unknown--'))
424 Search the list for empty ID fields and return true/false accordingly.
461 '--outfile', type=str,
465 '-p', '--path', type=str,
474 '-D', '--directory', nargs='+', metavar='DIR',
476 '(default [tc-tests])')
478 '-f', '--file', nargs='+', metavar='FILE',
481 '-c', '--category', nargs='*', metavar='CATG', default=['+c'],
485 '-e', '--execute', nargs='+', metavar='ID',
488 '-l', '--list', action='store_true',
491 '-s', '--show', action='store_true', dest='showID',
494 '-i', '--id', action='store_true', dest='gen_id',
495 help='Generate ID numbers for new test cases')
497 '-v', '--verbose', action='count', default=0,
500 '--format', default='tap', const='tap', nargs='?',
503 parser.add_argument('-d', '--device',
508 '-P', '--pause', action='store_true',
509 help='Pause execution just before post-suite stage')
538 return [x["id"] for x in alltests]
551 Check if a given ID already exists in the list of test cases.
559 If a test case has a blank ID field, generate a random hex ID for it
564 if (c["id"] == ""):
570 c['id'] = newid
592 Remove tests from testlist that are not in the named id list.
593 If id list is empty, return empty list.
600 newlist = list(filter(lambda x: x['id'] in target_ids, testlist))
615 if catg in tc['category'] and tc['id'] not in test_ids:
617 test_ids.append(tc['id'])
633 testdirs = ['tc-tests']
636 # at least one file was specified - remove the default directory
666 cat_ids = [x['id'] for x in cattestcases]
669 alltestcases = cattestcases + [x for x in idtestcases if x['id'] not in cat_ids]
695 print("No empty ID fields found in test files.")
740 fname = 'test-results.{}'.format(suffix)