From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAB9EA0524; Mon, 24 Feb 2020 10:22:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A6031BFA5; Mon, 24 Feb 2020 10:22:37 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 882C51F1C for ; Mon, 24 Feb 2020 10:22:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 01:22:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,479,1574150400"; d="scan'208";a="237260383" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.203]) by orsmga003.jf.intel.com with ESMTP; 24 Feb 2020 01:22:33 -0800 From: lihong To: dts@dpdk.org Cc: lihong Date: Mon, 24 Feb 2020 09:53:51 +0800 Message-Id: <1582509231-30503-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/perf_virtio_user: fix issue of the json per patch result report in output X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: lihong --- tests/TestSuite_perf_virtio_user_loopback.py | 12 ++++++------ tests/TestSuite_perf_virtio_user_pvp.py | 15 +++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/TestSuite_perf_virtio_user_loopback.py b/tests/TestSuite_perf_virtio_user_loopback.py index 15bc54c..0fb97dd 100644 --- a/tests/TestSuite_perf_virtio_user_loopback.py +++ b/tests/TestSuite_perf_virtio_user_loopback.py @@ -71,6 +71,7 @@ class TestPerfVirtioUserLoopback(TestCase): self.vhost = self.dut.new_session(suite="vhost") self.virtio_user = self.dut.new_session(suite="virtio-user") self.save_result_flag = True + self.json_obj = dict() def set_up(self): """ @@ -237,9 +238,8 @@ class TestPerfVirtioUserLoopback(TestCase): self.nic+_single_core_perf.json in output folder if self.save_result_flag is True ''' - json_obj = dict() case_name = self.running_case - json_obj[case_name] = list() + self.json_obj[case_name] = list() status_result = [] for frame_size in self.test_parameters.keys(): for nb_desc in self.test_parameters[frame_size]: @@ -268,12 +268,12 @@ class TestPerfVirtioUserLoopback(TestCase): row_dict0['performance'].append(row_dict1) row_dict0['parameters'].append(row_dict2) row_dict0['parameters'].append(row_dict3) - json_obj[case_name].append(row_dict0) + self.json_obj[case_name].append(row_dict0) status_result.append(row_dict0['status']) with open(os.path.join(rst.path2Result, - '{0:s}_vhost_loopback_performance_virtio_user.json'.format( - self.nic)), 'w') as fp: - json.dump(json_obj, fp) + '{0:s}_{1}.json'.format( + self.nic, self.suite_name)), 'w') as fp: + json.dump(self.json_obj, fp) self.verify("Fail" not in status_result, "Exceeded Gap") def test_perf_loopback_packed_ring_inorder_mergeable(self): diff --git a/tests/TestSuite_perf_virtio_user_pvp.py b/tests/TestSuite_perf_virtio_user_pvp.py index d49bd19..2073426 100644 --- a/tests/TestSuite_perf_virtio_user_pvp.py +++ b/tests/TestSuite_perf_virtio_user_pvp.py @@ -42,7 +42,6 @@ from test_case import TestCase from packet import Packet from settings import UPDATE_EXPECTED, load_global_setting from copy import deepcopy -from prettytable import PrettyTable class TestVirtioSingleCorePerf(TestCase): @@ -63,6 +62,7 @@ class TestVirtioSingleCorePerf(TestCase): self.save_result_flag = True socket_num = len(set([int(core['socket']) for core in self.dut.cores])) self.socket_mem = ','.join(['1024']*socket_num) + self.json_obj = dict() def set_up(self): """ @@ -332,12 +332,11 @@ class TestVirtioSingleCorePerf(TestCase): def save_result(self, data): ''' Saves the test results as a separated file named with - self.nic+_single_core_perf.json in output folder + self.nic+_perf_virtio_user_pvp.json in output folder if self.save_result_flag is True ''' - json_obj = dict() case_name = self.running_case - json_obj[case_name] = list() + self.json_obj[case_name] = list() status_result = [] for frame_size in self.test_parameters.keys(): for nb_desc in self.test_parameters[frame_size]: @@ -366,12 +365,12 @@ class TestVirtioSingleCorePerf(TestCase): row_dict0['performance'].append(row_dict1) row_dict0['parameters'].append(row_dict2) row_dict0['parameters'].append(row_dict3) - json_obj[case_name].append(row_dict0) + self.json_obj[case_name].append(row_dict0) status_result.append(row_dict0['status']) with open(os.path.join(rst.path2Result, - '{0:s}_single_core_perf.json'.format( - self.nic)), 'w') as fp: - json.dump(json_obj, fp) + '{0:s}_{1}.json'.format( + self.nic, self.suite_name)), 'w') as fp: + json.dump(self.json_obj, fp) self.verify("Fail" not in status_result, "Exceeded Gap") def tear_down(self): -- 2.7.4