X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tools%2Fsysteminfo.py;h=f34bcce6a1df4ca31cb25bb3156307f7619ed69e;hb=2cfae5e4569bf595e238a4ccb56a6ef5544a3265;hp=20ba7ba7e827bff068b3366f93f8b3629e5e4e98;hpb=5fe9089057bf23fd7ff312779d928cc9932fd38b;p=vswitchperf.git diff --git a/tools/systeminfo.py b/tools/systeminfo.py index 20ba7ba7..f34bcce6 100644 --- a/tools/systeminfo.py +++ b/tools/systeminfo.py @@ -185,7 +185,8 @@ def get_bin_version(binary, regex): :returns: version string or None """ try: - output = subprocess.check_output(binary, shell=True).decode().rstrip('\n') + output = str(subprocess.check_output( + binary, stderr=subprocess.STDOUT, shell=True).decode().rstrip('\n')) except subprocess.CalledProcessError: return None @@ -229,6 +230,7 @@ def get_version(app_name): 'loopback_l2fwd' : os.path.join(S.getValue('ROOT_DIR'), 'src/l2fwd/l2fwd.c'), 'ixnet' : os.path.join(S.getValue('TRAFFICGEN_IXNET_LIB_PATH'), 'pkgIndex.tcl'), 'ixia' : os.path.join(S.getValue('TRAFFICGEN_IXIA_ROOT_DIR'), 'lib/ixTcl1.0/ixTclHal.tcl'), + 'trex' : os.path.join(S.getValue('ROOT_DIR'), 'src/trex/trex'), } @@ -311,6 +313,9 @@ def get_version(app_name): app_version = match_line(app_version_file['ixia'], 'package provide IxTclHal') if app_version: app_version = app_version.split(' ')[3] + elif app_name.lower() == 'trex': + app_version = match_line(os.path.join(app_version_file['trex'], 'VERSION'), 'v') + app_git_tag = get_git_tag(app_version_file['trex']) elif app_name.lower() == 'xena': try: app_version = S.getValue('XENA_VERSION')