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)
358 res = TestResult(tidx['id'], tidx['name'])
361 print("Test " + tidx["id"] + ": " + tidx["name"])
365 res = TestResult(tidx['id'], tidx['name'])
378 res = TestResult(tidx['id'], tidx['name'])
386 NAMES['TESTID'] = tidx['id']
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)
464 pm.call_pre_suite(tcount, [tidx['id'] for tidx in testlist])
472 stage = 'pre-SUITE'
483 errmsg += "physical NIC with the -d option when running tdc.\n"
487 res = TestResult(tidx['id'], tidx['name'])
502 res = TestResult(tidx['id'], tidx['name'])
510 format(ex_type, ex, index, tidx['id'], tidx['name'], stage))
511 print('---------------')
514 print('---------------')
519 print('---------------')
524 # fill in the remaining tests with ok-skipped
528 for tidx in testlist[count - 1:]:
529 res = TestResult(tidx['id'], tidx['name'])
531 msg = 'skipped - previous {} failed {} {}'.format(stage,
532 index, badtest.get('id', '--Unknown--'))
548 Search the list for empty ID fields and return true/false accordingly.
585 '--outfile', type=str,
589 '-p', '--path', type=str,
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',
612 '-l', '--list', action='store_true',
615 '-s', '--show', action='store_true', dest='showID',
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='?',
627 parser.add_argument('-d', '--device',
632 '-P', '--pause', action='store_true',
633 help='Pause execution just before post-suite stage')
662 return [x["id"] for x in alltests]
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
688 if (c["id"] == ""):
694 c['id'] = newid
716 Remove tests from testlist that are not in the named id list.
717 If id list is empty, return empty list.
724 newlist = list(filter(lambda x: x['id'] in target_ids, testlist))
739 if catg in tc['category'] and tc['id'] not in test_ids:
741 test_ids.append(tc['id'])
757 testdirs = ['tc-tests']
760 # at least one file was specified - remove the default directory
790 cat_ids = [x['id'] for x in cattestcases]
793 alltestcases = cattestcases + [x for x in idtestcases if x['id'] not in cat_ids]
819 print("No empty ID fields found in test files.")
867 fname = 'test-results.{}'.format(suffix)