X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yardstick%2Fcmd%2FNSBperf.py;h=5d0aa746d14a30d40fbbe28c02ea2469daeee573;hb=b2971b66a73ed9068697920eddf6a17cfc0e4a0c;hp=011990a3d6b777efa42719f1606d21648e188e9c;hpb=3ac36ece91447e3ee8fdf687c8af82778482a0a4;p=yardstick.git diff --git a/yardstick/cmd/NSBperf.py b/yardstick/cmd/NSBperf.py index 011990a3d..5d0aa746d 100755 --- a/yardstick/cmd/NSBperf.py +++ b/yardstick/cmd/NSBperf.py @@ -30,13 +30,6 @@ from six.moves import input CLI_PATH = os.path.dirname(os.path.realpath(__file__)) REPO_PATH = os.path.abspath(os.path.join(CLI_PATH, os.pardir)) -PYTHONPATH = os.environ.get("PYTHONPATH", False) -VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", False) - - -if not PYTHONPATH or not VIRTUAL_ENV: - print("Please setup env PYTHONPATH & VIRTUAL_ENV environment varaible.") - raise SystemExit(1) def sigint_handler(*args, **kwargs): @@ -115,10 +108,10 @@ class YardstickNSCli(object): and generates final report in rst format. """ + tc_name = os.path.splitext(test_case)[0] report_caption = '{}\n{} ({})\n{}\n\n'.format( '================================================================', - 'Performance report for', - os.path.splitext(test_case)[0].upper(), + 'Performance report for', tc_name.upper(), '================================================================') print(report_caption) if os.path.isfile("/tmp/yardstick.out"): @@ -127,9 +120,10 @@ class YardstickNSCli(object): lines = jsonutils.load(infile) if lines: - lines = lines['result'] + lines = \ + lines['result']["testcases"][tc_name]["tc_data"] tc_res = lines.pop(len(lines) - 1) - for key, value in tc_res["benchmark"]["data"].items(): + for key, value in tc_res["data"].items(): self.generate_kpi_results(key, value) self.generate_nfvi_results(value) @@ -156,8 +150,24 @@ class YardstickNSCli(object): testcases = os.listdir(test_path + vnf) print(("VNF :(%s)" % vnf)) print("================") - for testcase in [tc for tc in testcases if "tc" in tc]: - print('%s' % testcase) + test_cases = [tc for tc in testcases if "tc_" in tc and "template" not in tc] + + print("\tBareMetal Testcase:") + print("\t===================") + for testcase in [tc for tc in test_cases if "baremetal" in tc]: + print("\t%s" % testcase) + + print(os.linesep) + print("\tStandalone Virtualization Testcase:") + print("\t===================================") + for testcase in [tc for tc in test_cases if "ovs" in tc or "sriov" in tc]: + print("\t%s" % testcase) + + print(os.linesep) + print("\tOpenstack Testcase:") + print("\t===================") + for testcase in [tc for tc in test_cases if "heat" in tc]: + print("\t%s" % testcase) print(os.linesep) raise SystemExit(0)