<commit_before>#!/usr/bin/python
#
# Copyright (c) 2015 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 0.1: This script boots the VM1 and allocates IP address from Nova
# Later, the VM2 boots then execute cloud-init to ping VM1.
# After successful ping, both the VMs are deleted.
# 0.2: measure test duration and publish results under json format
#
#
import argparse
import time

import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils


parser = argparse.ArgumentParser()
parser.add_argument("-r", "--report",
                    help="Create json result file",
                    action="store_true")
args = parser.parse_args()

functest_yaml = functest_utils.get_functest_yaml()

dirs = functest_yaml.get('general').get('directories')
DOCTOR_REPO = dirs.get('dir_repo_doctor')
RESULTS_DIR = functest_utils.get_parameter_from_yaml(
    'general.directories.dir_results')

logger = ft_logger.Logger("doctor").getLogger()


def main():
    exit_code = -1
    cmd = 'cd %s/tests && ./run.sh' % DOCTOR_REPO
    log_file = RESULTS_DIR + "/doctor.log"

    start_time = time.time()

    ret = functest_utils.execute_command(cmd,
                                         info=True,
                                         exit_on_error=False,
                                         output_file=log_file)

    stop_time = time.time()
    duration = round(stop_time - start_time, 1)
    if ret == 0:
        logger.info("Doctor test case OK")
        test_status = 'OK'<commit_msg>Add support of arm for doctor<commit_after>#!/usr/bin/python
#
# Copyright (c) 2015 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 0.1: This script boots the VM1 and allocates IP address from Nova
# Later, the VM2 boots then execute cloud-init to ping VM1.
# After successful ping, both the VMs are deleted.
# 0.2: measure test duration and publish results under json format
#
#
import argparse
import os
import time

import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils


parser = argparse.ArgumentParser()
parser.add_argument("-r", "--report",
                    help="Create json result file",
                    action="store_true")
args = parser.parse_args()

functest_yaml = functest_utils.get_functest_yaml()

DOCTOR_REPO = functest_utils.get_parameter_from_yaml(
    'general.directories.dir_repo_doctor')
RESULTS_DIR = functest_utils.get_parameter_from_yaml(
    'general.directories.dir_results')

logger = ft_logger.Logger("doctor").getLogger()


def main():
    exit_code = -1

    # if the image name is explicitly set for the doctor suite, set it as
    # enviroment variable
    if 'doctor' in functest_yaml and 'image_name' in functest_yaml['doctor']:
        os.environ["IMAGE_NAME"] = functest_yaml['doctor']['image_name']

    cmd = 'cd %s/tests && ./run.sh' % DOCTOR_REPO
    log_file = RESULTS_DIR + "/doctor.log"

    start_time = time.time()

    ret = functest_utils.execute_command(cmd,
                                         info=True,
                                         exit_on_error=False,
                                         output_file=log_file)

    stop_time = time.time()
    duration = round(stop_time - start_time, 1)
    if ret == 0:
        logger.info("Doctor test case OK")
        test_status = 'OK'
{'fraction_non_alphanumeric': 0.09553117473909553, 'fraction_numerical': 0.009633395772009633, 'mean_word_length': 2.89375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6317528', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1094, 'n_words': 315}