7 from api.utils import common as common_utils
9 logger = logging.getLogger(__name__)
12 def runTestCase(args):
14 opts = args.get('opts', {})
15 testcase = args['testcase']
17 logger.error('Lack of testcase argument')
20 'message': 'need testcase name'
22 return json.dumps(result)
24 testcase = os.path.join(conf.TEST_CASE_PATH,
25 conf.TEST_CASE_PRE + testcase + '.yaml')
27 task_id = str(uuid.uuid4())
29 command_list = ['task', 'start']
30 command_list = common_utils.get_command_list(command_list, opts, testcase)
31 logger.debug('The command_list is: %s', command_list)
33 logger.debug('Start to execute command list')
34 common_utils.exec_command_task(command_list, task_id)
40 return json.dumps(result)