Lines Matching +full:proc +full:- +full:id

2 # SPDX-License-Identifier: GPL-2.0
5 tdc.py - Linux tc (Traffic Control) unit test driver
55 mn = fn[0:-3]
61 pgname = pgname[0:-3]
72 self.plugin_instances[-1][1].check_args(self.args, None)
101 pgd = ['plugin-lib', 'plugin-lib-custom']
146 print('testid is {}'.format(caseinfo['id']))
215 proc = subprocess.Popen(command,
222 (rawout, serr) = proc.communicate(timeout=NAMES['TIMEOUT'])
223 if proc.returncode != 0 and len(serr) > 0:
224 foutput = serr.decode("utf-8", errors="ignore")
226 foutput = rawout.decode("utf-8", errors="ignore")
229 proc.returncode = 255
231 proc.stdout.close()
232 proc.stderr.close()
233 return proc, foutput
254 (proc, foutput) = exec_cmd(caseinfo, args, pm, stage, cmd)
256 if proc and (proc.returncode not in exit_codes):
262 print("returncode {}; expected {}".format(proc.returncode,
265 print("\n\n{} *** stdout ***".format(proc.stdout), file=sys.stderr)
266 print("\n\n{} *** stderr ***".format(proc.stderr), file=sys.stderr)
384 res = TestResult(tidx['id'], tidx['name'])
387 print("Test " + tidx["id"] + ": " + tidx["name"])
391 res = TestResult(tidx['id'], tidx['name'])
404 res = TestResult(tidx['id'], tidx['name'])
412 NAMES['TESTID'] = tidx['id']
413 NAMES['NS'] = '{}-{}'.format(NAMES['NS'], tidx['random'])
414 NAMES['DEV0'] = '{}id{}'.format(NAMES['DEV0'], tidx['id'])
415 NAMES['DEV1'] = '{}id{}'.format(NAMES['DEV1'], tidx['id'])
416 NAMES['DUMMY'] = '{}id{}'.format(NAMES['DUMMY'], tidx['id'])
419 prepare_env(tidx, args, pm, 'setup', "-----> prepare stage", tidx["setup"])
422 print('-----> execute stage')
441 print('-----> verify stage')
464 prepare_env(tidx, args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
523 errmsg += "physical NIC with the -d option when running tdc.\n"
527 res = TestResult(tidx['id'], tidx['name'])
542 res = TestResult(tidx['id'], tidx['name'])
550 format(ex_type, ex, index, tidx['id'], tidx['name'], stage))
551 print('---------------')
554 print('---------------')
559 print('---------------')
564 # fill in the remaining tests with ok-skipped
568 for tidx in testlist[count - 1:]:
569 res = TestResult(tidx['id'], tidx['name'])
571 msg = 'skipped - previous {} failed {} {}'.format(stage,
572 index, badtest.get('id', '--Unknown--'))
649 Search the list for empty ID fields and return true/false accordingly.
689 '--outfile', type=str,
693 '-p', '--path', type=str,
702 '-D', '--directory', nargs='+', metavar='DIR',
704 '(default [tc-tests])')
706 '-f', '--file', nargs='+', metavar='FILE',
709 '-c', '--category', nargs='*', metavar='CATG', default=['+c'],
713 '-e', '--execute', nargs='+', metavar='ID',
716 '-l', '--list', action='store_true',
719 '-s', '--show', action='store_true', dest='showID',
722 '-i', '--id', action='store_true', dest='gen_id',
723 help='Generate ID numbers for new test cases')
725 '-v', '--verbose', action='count', default=0,
728 '--format', default='tap', const='tap', nargs='?',
731 parser.add_argument('-d', '--device',
736 '-P', '--pause', action='store_true',
737 help='Pause execution just before post-suite stage')
739 '-J', '--multiprocess', type=int, default=1, dest='mp',
769 return [x["id"] for x in alltests]
781 Check if a given ID already exists in the list of test cases.
789 If a test case has a blank ID field, generate a random hex ID for it
793 if (c["id"] == ""):
799 c['id'] = newid
821 Remove tests from testlist that are not in the named id list.
822 If id list is empty, return empty list.
829 newlist = list(filter(lambda x: x['id'] in target_ids, testlist))
844 if catg in tc['category'] and tc['id'] not in test_ids:
846 test_ids.append(tc['id'])
865 testdirs = ['tc-tests']
868 # at least one file was specified - remove the default directory
898 cat_ids = [x['id'] for x in cattestcases]
901 alltestcases = cattestcases + [x for x in idtestcases if x['id'] not in cat_ids]
927 print("No empty ID fields found in test files.")
982 fname = 'test-results.{}'.format(suffix)
1023 # Cleanup on Ctrl-C