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 D140BA0524; Mon, 24 Feb 2020 10:23:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA2051BFA5; Mon, 24 Feb 2020 10:23:37 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 42CF91F1C for ; Mon, 24 Feb 2020 10:23:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 01:23:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,479,1574150400"; d="scan'208";a="225916502" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 24 Feb 2020 01:23:35 -0800 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 24 Feb 2020 01:23:34 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 24 Feb 2020 17:23:32 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Mon, 24 Feb 2020 17:23:32 +0800 From: "Ma, LihongX" To: "dts@dpdk.org" Thread-Topic: [dts][PATCH V1] tests/perf_virtio_user: fix issue of the json per patch result report in output Thread-Index: AQHV6vP2t7CzJgrmhEihsUBNFDa1cKgqEixA Date: Mon, 24 Feb 2020 09:23:32 +0000 Message-ID: References: <1582509231-30503-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1582509231-30503-1-git-send-email-lihongx.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Tested-by:ma,lihong Regards, Ma,lihong -----Original Message----- From: Ma, LihongX=20 Sent: Monday, February 24, 2020 9:54 AM To: dts@dpdk.org Cc: Ma, LihongX Subject: [dts][PATCH V1] tests/perf_virtio_user: fix issue of the json per = patch result report in output 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 =3D self.dut.new_session(suite=3D"vhost") self.virtio_user =3D self.dut.new_session(suite=3D"virtio-user") self.save_result_flag =3D True + self.json_obj =3D dict() =20 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 =3D dict() case_name =3D self.running_case - json_obj[case_name] =3D list() + self.json_obj[case_name] =3D list() status_result =3D [] 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_us= er.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") =20 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 impo= rt deepcopy -from prettytable import PrettyTable =20 =20 class TestVirtioSingleCorePerf(TestCase): @@ -63,6 +62,7 @@ class TestVirtioSingleCorePerf(TestCase): self.save_result_flag =3D True socket_num =3D len(set([int(core['socket']) for core in self.dut.c= ores])) self.socket_mem =3D ','.join(['1024']*socket_num) + self.json_obj =3D dict() =20 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 =3D dict() case_name =3D self.running_case - json_obj[case_name] =3D list() + self.json_obj[case_name] =3D list() status_result =3D [] 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") =20 def tear_down(self): -- 2.7.4