Update NSBPerf CLI to adapt to new output format 91/36191/3
authorDeepak S <deepak.s@linux.intel.com>
Mon, 19 Jun 2017 10:31:34 +0000 (10:31 +0000)
committerDeepak S <deepak.s@linux.intel.com>
Mon, 10 Jul 2017 06:08:59 +0000 (23:08 -0700)
Change-Id: I1d928857c320e4b8ca326f60b419e7b339599ce1
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
yardstick/cmd/NSBperf.py

index f158d57..3a6d604 100755 (executable)
@@ -117,10 +117,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"):
@@ -129,9 +129,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)
 
@@ -158,7 +159,7 @@ 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]:
+                for testcase in [tc for tc in testcases if "tc_" in tc]:
                     print('%s' % testcase)
                 print(os.linesep)
             raise SystemExit(0)