From 7d4d546a0be38dcd49a2fc6e0a13fdc1ab9fd311 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Thu, 17 Sep 2015 18:31:08 +0200 Subject: creation of scripts to generate Dashboard compatible json result files JIRA: FUNCTEST-45 Change-Id: I2336b830d3b5079f45c96bbb69061c8020ea637a Signed-off-by: Morgan Richomme --- testcases/Dashboard/rally2Dashboard.py | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 testcases/Dashboard/rally2Dashboard.py (limited to 'testcases/Dashboard/rally2Dashboard.py') diff --git a/testcases/Dashboard/rally2Dashboard.py b/testcases/Dashboard/rally2Dashboard.py new file mode 100644 index 000000000..20e597468 --- /dev/null +++ b/testcases/Dashboard/rally2Dashboard.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +# +# Copyright (c) 2015 Orange +# morgan.richomme@orange.com +# +# 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 +# +# This script is used to build json files for the dashboard +# for the rally test case +# +# v0.1: basic example +# +import logging +import argparse +import pprint +# import json +# import dashboard_utils +import os +import yaml + +pp = pprint.PrettyPrinter(indent=4) + +parser = argparse.ArgumentParser() +parser.add_argument("repo_path", help="Path to the repository") +parser.add_argument("-d", "--debug", help="Debug mode", action="store_true") +args = parser.parse_args() + +""" logging configuration """ +logger = logging.getLogger('config_functest') +logger.setLevel(logging.DEBUG) + +if not os.path.exists(args.repo_path): + logger.error("Repo directory not found '%s'" % args.repo_path) + exit(-1) + +with open(args.repo_path+"testcases/config_functest.yaml") as f: + functest_yaml = yaml.safe_load(f) +f.close() + +""" global variables """ +# Directories +HOME = os.environ['HOME']+"/" +REPO_PATH = args.repo_path +TEST_DB = functest_yaml.get("results").get("test_db_url") + + +def format_tempest_for_dashboard(criteria): + logger.debug("generate dashboard json files for rally") -- cgit 1.2.3-korg