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 403CFA0524; Tue, 25 Feb 2020 02:29:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37FE51BFA5; Tue, 25 Feb 2020 02:29:28 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 0126E2C39 for ; Tue, 25 Feb 2020 02:29:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 17:29:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,482,1574150400"; d="scan'208";a="241177923" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 24 Feb 2020 17:29:24 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 24 Feb 2020 17:29:24 -0800 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 24 Feb 2020 17:29:24 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.97]) with mapi id 14.03.0439.000; Tue, 25 Feb 2020 09:29:21 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/perf_virtio_user: fix issue of the json per patch result report in output Thread-Index: AQHV6vP/CInDVEi+oUeeUXfdxf02dagrIBBw Date: Tue, 25 Feb 2020 01:29:20 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBCDBC3@SHSMSX101.ccr.corp.intel.com> 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: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > 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 p= er > patch result report in output >=20 > 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(-) >=20 > 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_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") >=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 import 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= .cores])) > 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