def profile_results(results, installer, profile_fd):
    result_criterias = {}
    for s_p, s_p_result in results.iteritems():
        avg_last_ten = sum([int(s) for s in s_p_result]) / len(s_p_result)

        LASTEST_TESTS = rp_utils.get_config(
            'general.nb_iteration_tests_success_criteria')
        last_four = s_p_result[-LASTEST_TESTS:]
        avg_last_four = sum([int(s) for s in last_four]) / len(last_four)

        info = '{},{},{},{},{}\n'.format(reportingDate, s_p, installer, '',
                                         avg_last_four)
        profile_fd.write(info)
        result_criterias[s_p] = sr.ScenarioResult('OK', avg_last_four,
                                                  avg_last_ten, '100')

        logger.info("--------------------------")
    return result_criterias
Beispiel #2
0
def profile_results(results, installer, profile_fd):
    result_criterias = {}
    for s_p, s_p_result in results.iteritems():
        ten_criteria = len(s_p_result)
        ten_score = sum(s_p_result)

        LASTEST_TESTS = rp_utils.get_config(
            'general.nb_iteration_tests_success_criteria')
        four_result = s_p_result[:LASTEST_TESTS]
        four_criteria = len(four_result)
        four_score = sum(four_result)

        s_four_score = str(four_score / four_criteria)
        s_ten_score = str(ten_score / ten_criteria)

        info = '{},{},{},{},{}\n'.format(reportingDate, s_p, installer,
                                         s_ten_score, s_four_score)
        profile_fd.write(info)
        result_criterias[s_p] = sr.ScenarioResult('OK', s_four_score,
                                                  s_ten_score, '100')

        logger.info("--------------------------")
    return result_criterias
Beispiel #3
0
# 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
#
import datetime
import jinja2
import os

import scenarioResult as sr
from scenarios import config as cf

# manage conf
import utils.reporting_utils as rp_utils

installers = rp_utils.get_config('general.installers')
versions = rp_utils.get_config('general.versions')
PERIOD = rp_utils.get_config('general.period')

# Logger
logger = rp_utils.getLogger("Yardstick-Status")
reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")

logger.info("*******************************************")
logger.info("*   Generating reporting scenario status  *")
logger.info("*   Data retention = %s days              *" % PERIOD)
logger.info("*                                         *")
logger.info("*******************************************")

# For all the versions
for version in versions:
Beispiel #4
0
# 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
# SPDX-license-identifier: Apache-2.0

from urllib2 import Request, urlopen, URLError
from datetime import datetime
import json
import jinja2
import os

# manage conf
import utils.reporting_utils as rp_utils

installers = rp_utils.get_config('general.installers')
items = ["tests", "Success rate", "duration"]

CURRENT_DIR = os.getcwd()

PERIOD = rp_utils.get_config('general.period')
criteria_nb_test = 165
criteria_duration = 1800
criteria_success_rate = 90

logger = rp_utils.getLogger("Tempest")
logger.info("************************************************")
logger.info("*   Generating reporting Tempest_smoke_serial  *")
logger.info("*   Data retention = %s days                   *" % PERIOD)
logger.info("*                                              *")
logger.info("************************************************")
Beispiel #5
0
#!/usr/bin/python
#
# 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
#
import datetime
import os

import jinja2
import utils.reporting_utils as rp_utils
import utils.scenarioResult as sr

installers = rp_utils.get_config('general.installers')
versions = rp_utils.get_config('general.versions')
PERIOD = rp_utils.get_config('general.period')

# Logger
logger = rp_utils.getLogger("Qtip-Status")
reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")

logger.info("*******************************************")
logger.info("*   Generating reporting scenario status  *")
logger.info("*   Data retention = {} days              *".format(PERIOD))
logger.info("*                                         *")
logger.info("*******************************************")


def prepare_profile_file(version):
Beispiel #6
0
#!/usr/bin/python
#
# 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
#
import requests
import yaml

import utils.reporting_utils as rp_utils

yardstick_conf = rp_utils.get_config('yardstick.test_conf')
response = requests.get(yardstick_conf)
yaml_file = yaml.safe_load(response.text)
reporting = yaml_file.get('reporting')

config = {}

for element in reporting:
    name = element['name']
    scenarios = element['scenario']
    for s in scenarios:
        if name not in config:
            config[name] = {}
        config[name][s] = True
Beispiel #7
0
    nbSkipped = 0
    for data_test in sig_test:
        if data_test['result'] == "Passed":
            nbPassed += 1
        elif data_test['result'] == "Failed":
            nbFailures += 1
        elif data_test['result'] == "Skipped":
            nbSkipped += 1
    total_sig_test_result = {}
    total_sig_test_result['passed'] = nbPassed
    total_sig_test_result['failures'] = nbFailures
    total_sig_test_result['skipped'] = nbSkipped
    return total_sig_test_result


period = rp_utils.get_config('general.period')
versions = rp_utils.get_config('general.versions')
url_base = rp_utils.get_config('testapi.url')

logger.info("****************************************")
logger.info("*   Generating reporting vIMS          *")
logger.info("*   Data retention = %s days           *" % period)
logger.info("*                                      *")
logger.info("****************************************")

installers = rp_utils.get_config('general.installers')
step_order = ["initialisation", "orchestrator", "vIMS", "sig_test"]
logger.info("Start processing....")

# For all the versions
for version in versions:
Beispiel #8
0
# Logger
logger = rp_utils.getLogger("Functest-Status")

# Initialization
testValid = []
otherTestCases = []
reportingDate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")

# init just connection_check to get the list of scenarios
# as all the scenarios run connection_check
healthcheck = tc.TestCase("connection_check", "functest", -1)

# Retrieve the Functest configuration to detect which tests are relevant
# according to the installer, scenario
cf = rp_utils.get_config('functest.test_conf')
period = rp_utils.get_config('general.period')
versions = rp_utils.get_config('general.versions')
installers = rp_utils.get_config('general.installers')
blacklist = rp_utils.get_config('functest.blacklist')
log_level = rp_utils.get_config('general.log.log_level')
exclude_noha = rp_utils.get_config('functest.exclude_noha')
exclude_virtual = rp_utils.get_config('functest.exclude_virtual')

functest_yaml_config = rp_utils.getFunctestConfig()

logger.info("*******************************************")
logger.info("*                                         *")
logger.info("*   Generating reporting scenario status  *")
logger.info("*   Data retention: %s days               *" % period)
logger.info("*   Log level: %s                         *" % log_level)