Lines Matching defs:tidx
271 def verify_by_json(procout, res, tidx, args, pm):
279 matchJSON = json.loads(json.dumps(tidx['matchJSON']))
375 def run_one_test(pm, args, index, tidx):
384 res = TestResult(tidx['id'], tidx['name'])
387 print("Test " + tidx["id"] + ": " + tidx["name"])
389 if 'skip' in tidx:
390 if tidx['skip'] == 'yes':
391 res = TestResult(tidx['id'], tidx['name'])
394 pm.call_pre_case(tidx, test_skip=True)
395 pm.call_post_execute(tidx)
398 if 'dependsOn' in tidx:
401 (p, procout) = exec_cmd(tidx, args, pm, 'execute', tidx['dependsOn'])
404 res = TestResult(tidx['id'], tidx['name'])
407 pm.call_pre_case(tidx, test_skip=True)
408 pm.call_post_execute(tidx)
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'])
418 pm.call_pre_case(tidx)
419 prepare_env(tidx, args, pm, 'setup', "-----> prepare stage", tidx["setup"])
423 pm.call_pre_execute(tidx)
424 (p, procout) = exec_cmd(tidx, args, pm, 'execute', tidx["cmdUnderTest"])
430 pm.call_post_execute(tidx)
432 if (exit_code is None or exit_code != int(tidx["expExitCode"])):
434 print("exit: {}".format(int(tidx["expExitCode"])))
435 #print("exit: {!r} {}".format(exit_code, int(tidx["expExitCode"])))
437 res.set_failmsg('Command exited with {}, expected {}\n{}'.format(exit_code, tidx["expExitCode"], procout))
442 (p, procout) = exec_cmd(tidx, args, pm, 'verify', tidx["verifyCmd"])
444 if 'matchJSON' in tidx:
445 verify_by_json(procout, res, tidx, args, pm)
446 elif 'matchPattern' in tidx:
448 str(tidx["matchPattern"]), re.DOTALL | re.MULTILINE)
450 if len(match_index) != int(tidx["matchCount"]):
458 elif int(tidx["matchCount"]) != 0:
464 prepare_env(tidx, args, pm, 'teardown', '-----> teardown stage', tidx['teardown'], procout)
465 pm.call_post_case(tidx)
520 for tidx in testlist:
521 if "flower" in tidx["category"] and args.device == None:
527 res = TestResult(tidx['id'], tidx['name'])
534 badtest = tidx # in case it goes bad
535 res = run_one_test(pm, args, index, tidx)
542 res = TestResult(tidx['id'], tidx['name'])
550 format(ex_type, ex, index, tidx['id'], tidx['name'], stage))
568 for tidx in testlist[count - 1:]:
569 res = TestResult(tidx['id'], tidx['name'])
851 for tidx in alltests:
852 tidx['random'] = random.getrandbits(32)