1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
14 from api.utils import common as common_utils
16 logger = logging.getLogger(__name__)
19 def runTestCase(args):
21 opts = args.get('opts', {})
22 testcase = args['testcase']
24 return common_utils.error_handler('Lack of testcase argument')
26 testcase = os.path.join(conf.SAMPLE_PATH, testcase + '.yaml')
28 task_id = str(uuid.uuid4())
30 command_list = ['task', 'start']
31 command_list = common_utils.get_command_list(command_list, opts, testcase)
32 logger.debug('The command_list is: %s', command_list)
34 logger.debug('Start to execute command list')
35 common_utils.exec_command_task(command_list, task_id)
37 return common_utils.result_handler('success', task_id)