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 ##############################################################################
10 """Yardstick test suite api action"""
12 from __future__ import absolute_import
18 from api.utils import common as common_utils
20 logger = logging.getLogger(__name__)
23 def runTestSuite(args):
25 opts = args.get('opts', {})
26 testsuite = args['testsuite']
28 return common_utils.error_handler('Lack of testsuite argument')
30 if 'suite' not in opts:
31 opts['suite'] = 'true'
33 testsuite = os.path.join(conf.TEST_SUITE_PATH,
34 conf.TEST_SUITE_PRE + testsuite + '.yaml')
36 task_id = str(uuid.uuid4())
38 command_list = ['task', 'start']
39 command_list = common_utils.get_command_list(command_list, opts, testsuite)
40 logger.debug('The command_list is: %s', command_list)
42 logger.debug('Start to execute command list')
43 common_utils.exec_command_task(command_list, task_id)
45 return common_utils.result_handler('success', task_id)