From: Christian Trautman Date: Wed, 20 Apr 2016 20:37:51 +0000 (-0400) Subject: xena_version: Add versioning info for report file from Xena X-Git-Tag: colorado.1.0~86 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=eca9105cac5d465dfacf162200e09599c8b98c4b;p=vswitchperf.git xena_version: Add versioning info for report file from Xena Adds Xena version info to report files. Works by pulling the version info from the result file and adding it to the settings dictionary. JIRA: VSPERF-274 Change-Id: I2b7db30e5a621f32a7eaacfe48ab1bca498e4287 Signed-off-by: Christian Trautman --- diff --git a/tools/pkt_gen/xena/xena.py b/tools/pkt_gen/xena/xena.py index 969a5a88..dd23d0e5 100755 --- a/tools/pkt_gen/xena/xena.py +++ b/tools/pkt_gen/xena/xena.py @@ -75,6 +75,8 @@ class Xena(ITrafficGenerator): """ # get the test type from the report file test_type = root[0][1].get('TestType') + # set the version from the report file + settings.setValue('XENA_VERSION', root[0][0][1].get('GeneratedBy')) if test_type == 'Throughput': results = OrderedDict() diff --git a/tools/systeminfo.py b/tools/systeminfo.py index 531f1c92..ba490946 100644 --- a/tools/systeminfo.py +++ b/tools/systeminfo.py @@ -182,7 +182,7 @@ def get_version(app_name): 'dpdk' : os.path.join(S.getValue('RTE_SDK'), 'lib/librte_eal/common/include/rte_version.h'), 'qemu' : os.path.join(S.getValue('QEMU_DIR'), 'VERSION'), 'l2fwd' : os.path.join(S.getValue('ROOT_DIR'), 'src/l2fwd/l2fwd.c'), - 'ixnet' : os.path.join(S.getValue('TRAFFICGEN_IXNET_LIB_PATH'), 'pkgIndex.tcl') + 'ixnet' : os.path.join(S.getValue('TRAFFICGEN_IXNET_LIB_PATH'), 'pkgIndex.tcl'), } @@ -240,6 +240,12 @@ def get_version(app_name): app_version = match_line(app_version_file['ixnet'], 'package provide IxTclNetwork') if app_version: app_version = app_version.split(' ')[3] + elif app_name.lower() == 'xena': + try: + app_version = S.getValue('XENA_VERSION') + except AttributeError: + # setting was not available after execution + app_version = 'N/A' elif app_name.lower() == 'dummy': # get git tag of file with Dummy implementation app_git_tag = get_git_tag(os.path.join(S.getValue('ROOT_DIR'), 'tools/pkt_gen/dummy/dummy.py'))