X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fcmd%2FNSBperf.py;h=f158d57f4f2de67539d28ade05c3eae8c00c7254;hb=25a37b2048281c64719bd6ad67860f65f6c31546;hp=dd96b7fc8f4deaba1f72b23cbd3b753fb5f55488;hpb=5c8396ba5bbeb12c70dae6ad3e777a28fefbcb4a;p=yardstick.git diff --git a/yardstick/cmd/NSBperf.py b/yardstick/cmd/NSBperf.py index dd96b7fc8..f158d57f4 100755 --- a/yardstick/cmd/NSBperf.py +++ b/yardstick/cmd/NSBperf.py @@ -24,7 +24,7 @@ import argparse import json import subprocess import signal - +from oslo_serialization import jsonutils from six.moves import input @@ -115,7 +115,7 @@ class YardstickNSCli(object): def generate_final_report(self, test_case): """ Function will check if partial test results are available and generates final report in rst format. -""" + """ report_caption = '{}\n{} ({})\n{}\n\n'.format( '================================================================', @@ -126,10 +126,11 @@ class YardstickNSCli(object): if os.path.isfile("/tmp/yardstick.out"): lines = [] with open("/tmp/yardstick.out") as infile: - lines = infile.readlines() + lines = jsonutils.load(infile) if lines: - tc_res = json.loads(lines.pop(len(lines) - 1)) + lines = lines['result'] + tc_res = lines.pop(len(lines) - 1) for key, value in tc_res["benchmark"]["data"].items(): self.generate_kpi_results(key, value) self.generate_nfvi_results(value)