Merge "Include cirros image in the docker container"
[functest.git] / testcases / Dashboard / odl2Dashboard.py
1 #!/usr/bin/python
2 #
3 # Copyright (c) 2015 Orange
4 # morgan.richomme@orange.com
5 #
6 # This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # This script is used to build json files for the dashboard
13 # for the ODL test case
14 #
15 # v0.1: basic example
16 #
17 import logging
18 import argparse
19 import pprint
20 # import json
21 # import dashboard_utils
22 import os
23 import yaml
24
25 pp = pprint.PrettyPrinter(indent=4)
26
27 parser = argparse.ArgumentParser()
28 parser.add_argument("repo_path", help="Path to the repository")
29 parser.add_argument("-d", "--debug", help="Debug mode",  action="store_true")
30 args = parser.parse_args()
31
32 """ logging configuration """
33 logger = logging.getLogger('config_functest')
34 logger.setLevel(logging.DEBUG)
35
36 if not os.path.exists(args.repo_path):
37     logger.error("Repo directory not found '%s'" % args.repo_path)
38     exit(-1)
39
40 with open(args.repo_path+"testcases/config_functest.yaml") as f:
41     functest_yaml = yaml.safe_load(f)
42 f.close()
43
44 """ global variables """
45 # Directories
46 HOME = os.environ['HOME']+"/"
47 REPO_PATH = args.repo_path
48 TEST_DB = functest_yaml.get("results").get("test_db_url")
49
50
51 def format_tempest_for_dashboard(criteria):
52     logger.debug("generate dashboard json files for ODL suite")