summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/test/opts/one_click_deploy.py67
-rw-r--r--utils/test/reporting/html/euphrates.html141
-rw-r--r--utils/test/reporting/html/functest-euphrates.html109
-rw-r--r--utils/test/reporting/html/index.html30
-rw-r--r--utils/test/reporting/img/misc-npc-letterblock-m-800px.pngbin0 -> 92081 bytes
-rw-r--r--utils/test/reporting/reporting/reporting.yaml8
-rw-r--r--utils/test/reporting/reporting/yardstick/template/index-status-tmpl.html2
-rw-r--r--utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py37
8 files changed, 352 insertions, 42 deletions
diff --git a/utils/test/opts/one_click_deploy.py b/utils/test/opts/one_click_deploy.py
new file mode 100644
index 000000000..074827021
--- /dev/null
+++ b/utils/test/opts/one_click_deploy.py
@@ -0,0 +1,67 @@
+import argparse
+import os
+
+from jinja2 import Environment
+
+DOCKER_COMPOSE_FILE = './docker-compose.yml'
+DOCKER_COMPOSE_TEMPLATE = """
+version: '2'
+services:
+ mongo:
+ image: mongo:3.2.1
+ container_name: opnfv-mongo
+ testapi:
+ image: opnfv/testapi:latest
+ container_name: opnfv-testapi
+ environment:
+ - mongodb_url=mongodb://mongo:27017/
+ - base_url={{ vars.base_url }}
+ ports:
+ - "{{ vars.testapi_port }}:8000"
+ links:
+ - mongo
+ reporting:
+ image: opnfv/reporting:latest
+ container_name: opnfv-reporting
+ ports:
+ - "{{ vars.reporting_port }}:8000"
+"""
+
+
+def render_docker_compose(testapi_port, reporting_port, testapi_base_url):
+ vars = {
+ "testapi_port": testapi_port,
+ "reporting_port": reporting_port,
+ "base_url": testapi_base_url,
+ }
+ yml = Environment().from_string(DOCKER_COMPOSE_TEMPLATE).render(vars=vars)
+ with open(DOCKER_COMPOSE_FILE, 'w') as f:
+ f.write(yml)
+ f.close()
+
+
+def main(args):
+ render_docker_compose(args.testapi_port,
+ args.reporting_port,
+ args.testapi_base_url)
+ os.system('docker-compose -f {} up -d'.format(DOCKER_COMPOSE_FILE))
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(description='Backup MongoDBs')
+ parser.add_argument('-tp', '--testapi-port',
+ type=int,
+ required=False,
+ default=8082,
+ help='testapi exposed port')
+ parser.add_argument('-tl', '--testapi-base-url',
+ type=str,
+ required=True,
+ help='testapi exposed base-url')
+ parser.add_argument('-rp', '--reporting-port',
+ type=int,
+ required=False,
+ default=8084,
+ help='reporting exposed port')
+
+ main(parser.parse_args())
diff --git a/utils/test/reporting/html/euphrates.html b/utils/test/reporting/html/euphrates.html
new file mode 100644
index 000000000..86258ac23
--- /dev/null
+++ b/utils/test/reporting/html/euphrates.html
@@ -0,0 +1,141 @@
+<!DOCTYPE HTML>
+<!--
+ Phantom by HTML5 UP
+ html5up.net | @ajlkn
+ Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
+-->
+<html>
+ <head>
+ <title>Phantom by HTML5 UP</title>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
+ </head>
+ <body>
+ <!-- Wrapper -->
+ <div id="wrapper">
+
+ <!-- Header -->
+ <header id="header">
+ <div class="inner">
+
+ <!-- Logo -->
+ <a href="index.html" class="logo">
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ </a>
+
+ </div>
+ </header>
+
+ <!-- Menu -->
+ <!-- Main -->
+ <div id="main">
+ <div class="inner">
+ <header>
+ <h1>Danube reporting</h1>
+ </header>
+ <section class="tiles">
+ <article class="style3">
+ <span class="image">
+ <img src="img/projectIcon_functest_250x250.png" alt="" />
+ </span>
+ <a href="functest-euphrates.html">
+ <h2>Functest</h2>
+ <div class="content">
+ <p>Functional testing</p>
+ </div>
+ </a>
+ </article>
+ <article class="style2">
+ <span class="image">
+ <img src="img/projectIcon_yardstick_250x250.png" alt="" />
+ </span>
+ <a href="euphrates/yardstick/status-apex.html">
+ <h2>Yardstick</h2>
+ <div class="content">
+ <p>Qualification and performance testing</p>
+ </div>
+ </a>
+ </article>
+ <article class="style4">
+ <span class="image">
+ <img src="img/projectIcon_storperf_250x250.png" alt="" />
+ </span>
+ <a href="euphrates/storperf/status-apex.html">
+ <h2>Storperf</h2>
+ <div class="content">
+ <p>Storage testing</p>
+ </div>
+ </a>
+ </article>
+ <article class="style5">
+ <span class="image">
+ <img src="img/projectIcon_vsperf_250x250.png" alt="" />
+ </span>
+ <a href="euphrates/vsperf/status-apex.html">
+ <h2>Vsperf</h2>
+ <div class="content">
+ <p>Virtual switch testing</p>
+ </div>
+ </a>
+ </article>
+ <article class="style1">
+ <span class="image">
+ <img src="img/projectIcon_qtip_250x250.png" alt="" />
+ </span>
+ <a href="euphrates/qtip/status-apex.html">
+ <h2>Qtip</h2>
+ <div class="content">
+ <p>Benchmark as a service</p>
+ </div>
+ </a>
+ </article>
+ <article class="style6">
+ <span class="image">
+ <img src="img/projectIcon_bottlenecks_250x250.png" alt="" />
+ </span>
+ <a href="euphrates/bottlenecks/status-apex.html">
+ <h2>Bottlenecks</h2>
+ <div class="content">
+ <p>Bottleneck finder</p>
+ </div>
+ </a>
+ </article>
+ </section>
+ </div>
+ </div>
+
+ <!-- Footer -->
+ <footer id="footer">
+ <div class="inner">
+ <section>
+ <h2>OPNFV Testing Working group</h2>
+ </section>
+ <section>
+ <h2>Follow</h2>
+ <ul class="icons">
+ <li><a href="https://twitter.com/opnfv" class="icon style2 fa-twitter"><span class="label">Twitter</span></a></li>
+ <li><a href="http://git.opnfv.org" class="icon style2 fa-github"><span class="label">GitHub</span></a></li>
+ <li><a href="mailto:test-wg@list.opnfv.org" class="icon style2 fa-envelope-o"><span class="label">Email</span></a></li>
+ </ul>
+ </section>
+ <ul class="copyright">
+ <li>&copy; Untitled. All rights reserved</li><li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
+ </ul>
+ </div>
+ </footer>
+
+ </div>
+
+ <!-- Scripts -->
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
+
+ </body>
+</html>
diff --git a/utils/test/reporting/html/functest-euphrates.html b/utils/test/reporting/html/functest-euphrates.html
new file mode 100644
index 000000000..c203e6151
--- /dev/null
+++ b/utils/test/reporting/html/functest-euphrates.html
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML>
+<!--
+ Phantom by HTML5 UP
+ html5up.net | @ajlkn
+ Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
+-->
+<html>
+ <head>
+ <title>Phantom by HTML5 UP</title>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/html5shiv.js"></script><![endif]-->
+ <link rel="stylesheet" href="3rd_party/css/main.css" />
+ <!--[if lte IE 9]><link rel="stylesheet" href="3rd_party/css/ie9.css" /><![endif]-->
+ <!--[if lte IE 8]><link rel="stylesheet" href="3rd_party/css/ie8.css" /><![endif]-->
+ </head>
+ <body>
+ <!-- Wrapper -->
+ <div id="wrapper">
+
+ <!-- Header -->
+ <header id="header">
+ <div class="inner">
+
+ <!-- Logo -->
+ <a href="index.html" class="logo">
+ <span class="symbol"><img src="img/logo.svg" alt="" /></span><span class="title">Phantom</span>
+ </a>
+
+ </div>
+ </header>
+
+ <!-- Menu -->
+
+ <!-- Main -->
+ <div id="main">
+ <div class="inner">
+ <header>
+ <h1>Functest reporting</h1>
+ </header>
+ <section class="tiles">
+ <article class="style5">
+ <span class="image">
+ <img src="img/pic05.jpg" alt="" />
+ </span>
+ <a href="euphrates/functest/status-apex.html">
+ <h2>Status</h2>
+ <div class="content">
+ <p>Scenario status</p>
+ </div>
+ </a>
+ </article>
+ <article class="style2">
+ <span class="image">
+ <img src="img/pic02.jpg" alt="" />
+ </span>
+ <a href="euphrates/functest/vims-apex.html">
+ <h2>vIMS</h2>
+ <div class="content">
+ <p>Virtual IMS</p>
+ </div>
+ </a>
+ </article>
+ <article class="style3">
+ <span class="image">
+ <img src="img/pic03.jpg" alt="" />
+ </span>
+ <a href="euphrates/functest/tempest-apex.html">
+ <h2>Tempest</h2>
+ <div class="content">
+ <p>Tempest OpenStack suite</p>
+ </div>
+ </a>
+ </article>
+ </section>
+ </div>
+ </div>
+
+ <!-- Footer -->
+ <footer id="footer">
+ <div class="inner">
+ <section>
+ <h2>OPNFV Testing Working group</h2>
+ </section>
+ <section>
+ <h2>Follow</h2>
+ <ul class="icons">
+ <li><a href="https://twitter.com/opnfv" class="icon style2 fa-twitter"><span class="label">Twitter</span></a></li>
+ <li><a href="http://git.opnfv.org" class="icon style2 fa-github"><span class="label">GitHub</span></a></li>
+ <li><a href="mailto:test-wg@list.opnfv.org" class="icon style2 fa-envelope-o"><span class="label">Email</span></a></li>
+ </ul>
+ </section>
+ <ul class="copyright">
+ <li>&copy; Untitled. All rights reserved</li><li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
+ </ul>
+ </div>
+ </footer>
+
+ </div>
+
+ <!-- Scripts -->
+ <script src="3rd_party/js/jquery.min.js"></script>
+ <script src="3rd_party/js/skel.min.js"></script>
+ <script src="3rd_party/js/util.js"></script>
+ <!--[if lte IE 8]><script src="3rd_party/js/ie/respond.min.js"></script><![endif]-->
+ <script src="3rd_party/js/main.js"></script>
+
+ </body>
+</html>
diff --git a/utils/test/reporting/html/index.html b/utils/test/reporting/html/index.html
index c6627ffe5..27890451f 100644
--- a/utils/test/reporting/html/index.html
+++ b/utils/test/reporting/html/index.html
@@ -37,17 +37,6 @@
</div>
</header>
- <!-- Menu -->
- <!--- <nav id="menu">
- <h2>Menu</h2>
- <ul>
- <li><a href="index.html">Home</a></li>
- <li><a href="colorado.html">Colorado</a></li>
- <li><a href="danube.html">Danube</a></li>
- </ul>
- </nav>
- --->
- <!-- Main -->
<div id="main">
<div class="inner">
<header>
@@ -61,7 +50,7 @@
<a href="colorado.html">
<h2>Colorado</h2>
<div class="content">
- <p>Colorado 1.0 released on the 22nd of September</p>
+ <p>Colorado 1.0 (22/09/2016)</p>
</div>
</a>
</article>
@@ -72,17 +61,28 @@
<a href="danube.html">
<h2>Danube</h2>
<div class="content">
- <p>Danube 1.0 planned on the 22nd of March</p>
+ <p>Danube 1.0 (22/03/2017)</p>
</div>
</a>
</article>
- <article class="style6">
+ <article class="style4">
<span class="image">
<img src="img/euphrates.jpg" alt="" />
</span>
- <a href="master.html">
+ <a href="euphrates.html">
<h2>Euphrates</h2>
<div class="content">
+ <p>Euphreates (ETA 10/2017)</p>
+ </div>
+ </a>
+ </article>
+ <article class="style6">
+ <span class="image">
+ <img src="img/misc-npc-letterblock-m-800px.png" alt="" />
+ </span>
+ <a href="master.html">
+ <h2>Master</h2>
+ <div class="content">
<p>Master</p>
</div>
</a>
diff --git a/utils/test/reporting/img/misc-npc-letterblock-m-800px.png b/utils/test/reporting/img/misc-npc-letterblock-m-800px.png
new file mode 100644
index 000000000..9d62e9e73
--- /dev/null
+++ b/utils/test/reporting/img/misc-npc-letterblock-m-800px.png
Binary files differ
diff --git a/utils/test/reporting/reporting/reporting.yaml b/utils/test/reporting/reporting/reporting.yaml
index 9bb90b806..dae832ab5 100644
--- a/utils/test/reporting/reporting/reporting.yaml
+++ b/utils/test/reporting/reporting/reporting.yaml
@@ -9,6 +9,7 @@ general:
versions:
- master
+ - euphrates
- danube
log:
@@ -35,15 +36,8 @@ testapi:
functest:
blacklist:
- - ovno
- - security_scan
- - healthcheck
- odl_netvirt
- - aaa
- - cloudify_ims
- - orchestra_ims
- juju_epc
- - orchestra
max_scenario_criteria: 50
test_conf: https://git.opnfv.org/cgit/functest/plain/functest/ci/testcases.yaml
log_level: ERROR
diff --git a/utils/test/reporting/reporting/yardstick/template/index-status-tmpl.html b/utils/test/reporting/reporting/yardstick/template/index-status-tmpl.html
index 77ba9502f..f9b852490 100644
--- a/utils/test/reporting/reporting/yardstick/template/index-status-tmpl.html
+++ b/utils/test/reporting/reporting/yardstick/template/index-status-tmpl.html
@@ -25,7 +25,7 @@
}
// trend line management
- d3.csv("./scenario_history.csv", function(data) {
+ d3.csv("./scenario_history.txt", function(data) {
// ***************************************
// Create the trend line
{% for scenario in scenario_results.keys() -%}
diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py
index f5026c957..1df31f36c 100644
--- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py
+++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_result.py
@@ -11,6 +11,7 @@ from datetime import datetime
from datetime import timedelta
import httplib
import json
+import urllib
import unittest
from opnfv_testapi.common import message
@@ -268,29 +269,29 @@ class TestResultGet(TestResultBase):
@executor.query(httplib.BAD_REQUEST, message.must_int('period'))
def test_queryPeriodNotInt(self):
- return self._set_query('period=a')
+ return self._set_query(period='a')
@executor.query(httplib.OK, '_query_period_one', 1)
def test_queryPeriodSuccess(self):
- return self._set_query('period=5')
+ return self._set_query(period=5)
@executor.query(httplib.BAD_REQUEST, message.must_int('last'))
def test_queryLastNotInt(self):
- return self._set_query('last=a')
+ return self._set_query(last='a')
@executor.query(httplib.OK, '_query_last_one', 1)
def test_queryLast(self):
- return self._set_query('last=1')
+ return self._set_query(last=1)
@executor.query(httplib.OK, '_query_success', 4)
def test_queryPublic(self):
self._create_public_data()
- return self._set_query('')
+ return self._set_query()
@executor.query(httplib.OK, '_query_success', 1)
def test_queryPrivate(self):
self._create_private_data()
- return self._set_query('public=false')
+ return self._set_query(public='false')
@executor.query(httplib.OK, '_query_period_one', 1)
def test_combination(self):
@@ -303,12 +304,11 @@ class TestResultGet(TestResultBase):
'scenario',
'trust_indicator',
'criteria',
- 'period=5')
+ period=5)
@executor.query(httplib.OK, '_query_success', 0)
def test_notFound(self):
- return self._set_query('pod=notExistPod',
- 'project',
+ return self._set_query('project',
'case',
'version',
'installer',
@@ -316,7 +316,8 @@ class TestResultGet(TestResultBase):
'scenario',
'trust_indicator',
'criteria',
- 'period=1')
+ pod='notExistPod',
+ period=1)
@executor.query(httplib.OK, '_query_success', 1)
def test_filterErrorStartdate(self):
@@ -324,7 +325,7 @@ class TestResultGet(TestResultBase):
self._create_error_start_date('None')
self._create_error_start_date('null')
self._create_error_start_date('')
- return self._set_query('period=5')
+ return self._set_query(period=5)
def _query_success(self, body, number):
self.assertEqual(number, len(body.results))
@@ -363,18 +364,16 @@ class TestResultGet(TestResultBase):
self.create(req)
return req
- def _set_query(self, *args):
+ def _set_query(self, *args, **kwargs):
def get_value(arg):
return self.__getattribute__(arg) \
if arg != 'trust_indicator' else self.trust_indicator.current
- uri = ''
+ query = []
for arg in args:
- if arg:
- if '=' in arg:
- uri += arg + '&'
- else:
- uri += '{}={}&'.format(arg, get_value(arg))
- return uri[0: -1]
+ query.append((arg, get_value(arg)))
+ for k, v in kwargs.iteritems():
+ query.append((k, v))
+ return urllib.urlencode(query)
class TestResultUpdate(TestResultBase):