aboutsummaryrefslogtreecommitdiffstats
path: root/tools/report/report.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-01-11 17:56:45 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-01-19 13:10:29 +0000
commit6da6b66a1affe7a79180a49534602a02e7994c7f (patch)
tree6471656e169abd25b6c26b01adb5aabacf854831 /tools/report/report.py
parentc28daf3e37f38ec570b70f33e9ce18a8e6b24f61 (diff)
reporting: add vswitch, vnf and trafficgen version into the report
Final test report MD file should contain information about version of vswitch, vnf, VM loopback forwarding application and traffic generator used during the test. In case that component is cloned from GIT repository, then hash of its recent commit should be part of the report too. Change-Id: I4eb398bc95bc5030d0852d08bcf9febbf17640d4 JIRA: VSPERF-172 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Radek Zetik <radekx.zetik@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Brian Castelli <brian.castelli@spirent.com> Reviewed-by: Tv Rao <tv.rao@freescale.com>
Diffstat (limited to 'tools/report/report.py')
-rw-r--r--tools/report/report.py39
1 files changed, 24 insertions, 15 deletions
diff --git a/tools/report/report.py b/tools/report/report.py
index d51ff47d..4264c055 100644
--- a/tools/report/report.py
+++ b/tools/report/report.py
@@ -1,4 +1,4 @@
-# Copyright 2015 Intel Corporation.
+# Copyright 2015-2016 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,14 +24,14 @@ import jinja2
import logging
from core.results.results_constants import ResultsConstants
-from conf import settings
+from conf import settings as S
from tools import systeminfo
_TEMPLATE_FILE = 'report.jinja'
_ROOT_DIR = os.path.normpath(os.path.dirname(os.path.realpath(__file__)))
-def _get_env():
+def _get_env(result):
"""
Get system configuration.
@@ -53,8 +53,18 @@ def _get_env():
'cpu_cores': systeminfo.get_cpu_cores(),
'memory' : systeminfo.get_memory(),
'platform': systeminfo.get_platform(),
+ 'vsperf': systeminfo.get_version('vswitchperf'),
+ 'traffic_gen': systeminfo.get_version(S.getValue('TRAFFICGEN')),
+ 'vswitch': systeminfo.get_version(S.getValue('VSWITCH')),
+ 'dpdk': systeminfo.get_version('dpdk'),
}
+ if result[ResultsConstants.DEPLOYMENT].count('v'):
+ env.update({'vnf': systeminfo.get_version(S.getValue('VNF')),
+ 'guest_image': S.getValue('GUEST_IMAGE'),
+ 'loopback_app': list(map(systeminfo.get_version, S.getValue('GUEST_LOOPBACK'))),
+ })
+
return env
@@ -78,28 +88,27 @@ def generate(input_file, tc_results, tc_stats):
try:
for result in tc_results:
test_config = {}
- for tc_conf in settings.getValue('PERFORMANCE_TESTS'):
+ for tc_conf in S.getValue('PERFORMANCE_TESTS'):
if tc_conf['Name'] == result[ResultsConstants.ID]:
test_config = tc_conf
break
- # remove id and deployment from results but store their values
- tc_id = result[ResultsConstants.ID]
- tc_deployment = result[ResultsConstants.DEPLOYMENT]
- del result[ResultsConstants.ID]
- del result[ResultsConstants.DEPLOYMENT]
-
# pass test results, env details and configuration to template
tests.append({
- 'ID': tc_id.upper(),
- 'id': tc_id,
- 'deployment': tc_deployment,
+ 'ID': result[ResultsConstants.ID].upper(),
+ 'id': result[ResultsConstants.ID],
+ 'deployment': result[ResultsConstants.DEPLOYMENT],
'conf': test_config,
'result': result,
- 'env': _get_env(),
+ 'env': _get_env(result),
'stats': tc_stats
})
+ # remove id and deployment from results before rendering
+ # but after _get_env() is called; tests dict has its shallow copy
+ del result[ResultsConstants.ID]
+ del result[ResultsConstants.DEPLOYMENT]
+
template_vars = {
'tests': tests,
}
@@ -117,6 +126,6 @@ def generate(input_file, tc_results, tc_stats):
if __name__ == '__main__':
- settings.load_from_dir('conf')
+ S.load_from_dir('conf')
OUT = generate(sys.argv[1], '', '')
print('Test report written to "%s"...' % OUT)