• Home
  • Raw
  • Download

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']
132 print('testid is {}'.format(caseinfo['id']))
192 proc = subprocess.Popen(command,
199 (rawout, serr) = proc.communicate(timeout=NAMES['TIMEOUT'])
200 if proc.returncode != 0 and len(serr) > 0:
201 foutput = serr.decode("utf-8", errors="ignore")
203 foutput = rawout.decode("utf-8", errors="ignore")
206 proc.returncode = 255
208 proc.stdout.close()
209 proc.stderr.close()
210 return proc, foutput
231 (proc, foutput) = exec_cmd(args, pm, stage, cmd)
233 if proc and (proc.returncode not in exit_codes):
239 print("returncode {}; expected {}".format(proc.returncode,
242 print("\n\n{} *** stdout ***".format(proc.stdout), file=sys.stderr)
243 print("\n\n{} *** stderr ***".format(proc.stderr), file=sys.stderr)
357 res = TestResult(tidx['id'], tidx['name'])
360 print("Test " + tidx["id"] + ": " + tidx["name"])
364 res = TestResult(tidx['id'], tidx['name'])
377 res = TestResult(tidx['id'], tidx['name'])
385 NAMES['TESTID'] = tidx['id']
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)
463 pm.call_pre_suite(tcount, [tidx['id'] for tidx in testlist])
471 stage = 'pre-SUITE'
482 errmsg += "physical NIC with the -d option when running tdc.\n"
486 res = TestResult(tidx['id'], tidx['name'])
501 res = TestResult(tidx['id'], tidx['name'])
509 format(ex_type, ex, index, tidx['id'], tidx['name'], stage))
510 print('---------------')
513 print('---------------')
518 print('---------------')
523 # fill in the remaining tests with ok-skipped
527 for tidx in testlist[count - 1:]:
528 res = TestResult(tidx['id'], tidx['name'])
530 msg = 'skipped - previous {} failed {} {}'.format(stage,
531 index, badtest.get('id', '--Unknown--'))
547 Search the list for empty ID fields and return true/false accordingly.
584 '--outfile', type=str,
588 '-p', '--path', type=str,
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',
611 '-l', '--list', action='store_true',
614 '-s', '--show', action='store_true', dest='showID',
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='?',
626 parser.add_argument('-d', '--device',
631 '-P', '--pause', action='store_true',
632 help='Pause execution just before post-suite stage')
661 return [x["id"] for x in alltests]
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
687 if (c["id"] == ""):
693 c['id'] = newid
715 Remove tests from testlist that are not in the named id list.
716 If id list is empty, return empty list.
723 newlist = list(filter(lambda x: x['id'] in target_ids, testlist))
738 if catg in tc['category'] and tc['id'] not in test_ids:
740 test_ids.append(tc['id'])
756 testdirs = ['tc-tests']
759 # at least one file was specified - remove the default directory
789 cat_ids = [x['id'] for x in cattestcases]
792 alltestcases = cattestcases + [x for x in idtestcases if x['id'] not in cat_ids]
818 print("No empty ID fields found in test files.")
866 fname = 'test-results.{}'.format(suffix)