Esempio n. 1
0
def runTestSuite(args):
    try:
        opts = args.get('opts', {})
        testsuite = args['testsuite']
    except KeyError:
        return common_utils.error_handler('Lack of testsuite argument')

    if 'suite' not in opts:
        opts['suite'] = 'true'

    testsuite = os.path.join(consts.TESTSUITE_DIR, '{}.yaml'.format(testsuite))

    task_id = str(uuid.uuid4())

    command_list = ['task', 'start']
    command_list = common_utils.get_command_list(command_list, opts, testsuite)
    logger.debug('The command_list is: %s', command_list)

    logger.debug('Start to execute command list')
    task_dic = {
        'task_id': task_id,
        'details': _get_cases_from_suite_file(testsuite)
    }
    common_utils.exec_command_task(command_list, task_dic)

    return common_utils.result_handler('success', task_id)
Esempio n. 2
0
def runTestCase(args):
    try:
        opts = args.get('opts', {})
        testcase = args['testcase']
    except KeyError:
        return common_utils.error_handler('Lack of testcase argument')

    testcase_name = conf.TEST_CASE_PRE + testcase
    testcase = os.path.join(conf.TEST_CASE_PATH, testcase_name + '.yaml')

    task_id = str(uuid.uuid4())

    command_list = ['task', 'start']
    command_list = common_utils.get_command_list(command_list, opts, testcase)
    logger.debug('The command_list is: %s', command_list)

    logger.debug('Start to execute command list')
    task_dict = {'task_id': task_id, 'details': testcase_name}
    common_utils.exec_command_task(command_list, task_dict)

    return common_utils.result_handler('success', task_id)
Esempio n. 3
0
def runTestSuite(args):
    try:
        opts = args.get('opts', {})
        testsuite = args['testsuite']
    except KeyError:
        return common_utils.error_handler('Lack of testsuite argument')

    if 'suite' not in opts:
        opts['suite'] = 'true'

    testsuite = os.path.join(conf.TEST_SUITE_PATH,
                             conf.TEST_SUITE_PRE + testsuite + '.yaml')

    task_id = str(uuid.uuid4())

    command_list = ['task', 'start']
    command_list = common_utils.get_command_list(command_list, opts, testsuite)
    logger.debug('The command_list is: %s', command_list)

    logger.debug('Start to execute command list')
    common_utils.exec_command_task(command_list, task_id)

    return common_utils.result_handler('success', task_id)