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 D72E6A0564; Tue, 24 Mar 2020 07:51:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE62F1C0BE; Tue, 24 Mar 2020 07:51:54 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 31AC61C07D for ; Tue, 24 Mar 2020 07:51:53 +0100 (CET) IronPort-SDR: wtXBEH1UbTq74yf6+ruBpOK3bLdxIilve7Lzx0MFfKEb1HKuZ66L6IykQCI+Aev3SOl9ujOEga ZlJSLk/fRHnw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2020 23:51:52 -0700 IronPort-SDR: d7VtUn7Ta7W0Soa/LD8fHLV2qccdV3f5JoEVE5lvqEsZpVQUpQYCfB7ueRdAGonN5KwHAOWVWm r1aClBZ0+w7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,299,1580803200"; d="scan'208";a="270237766" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 23 Mar 2020 23:51:51 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Mar 2020 23:51:51 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Mar 2020 23:51:51 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.43]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.206]) with mapi id 14.03.0439.000; Tue, 24 Mar 2020 14:51:49 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Yao, Lei A" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 1/1] tests/power_bidirection_channel: python3 support and script Thread-Index: AQHWALjO9qKu3mcn902P5FqQauOV7KhXT+yw Date: Tue, 24 Mar 2020 06:51:48 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBF0A5B@SHSMSX101.ccr.corp.intel.com> References: <20200323021031.11393-1-yufengx.mo@intel.com> <20200323021031.11393-2-yufengx.mo@intel.com> In-Reply-To: <20200323021031.11393-2-yufengx.mo@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 1/1] tests/power_bidirection_channel: python3 support and script 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 yufengmx > Sent: Monday, March 23, 2020 10:11 AM > To: dts@dpdk.org; Yao, Lei A > Cc: Mo, YufengX > Subject: [dts] [PATCH V1 1/1] tests/power_bidirection_channel: python3 > support and script >=20 > optimize >=20 > #. python3 support. > #. display dpdk version. > #. use ^C to take the place of killall. >=20 > Signed-off-by: yufengmx > --- > tests/TestSuite_power_bidirection_channel.py | 21 ++++++++------------ > 1 file changed, 8 insertions(+), 13 deletions(-) >=20 > diff --git a/tests/TestSuite_power_bidirection_channel.py > b/tests/TestSuite_power_bidirection_channel.py > index ed82fda..8159e11 100644 > --- a/tests/TestSuite_power_bidirection_channel.py > +++ b/tests/TestSuite_power_bidirection_channel.py > @@ -31,7 +31,7 @@ >=20 > """ > DPDK Test suite. > -virtual power manager test suite. > +power bidirection channel test suite. > """ > import os > import time > @@ -44,8 +44,6 @@ from test_case import TestCase >=20 >=20 > class TestPowerBidirectionChannel(TestCase): > - # temporary file directory > - output_path =3D '/tmp' >=20 > @property > def target_dir(self): > @@ -95,7 +93,7 @@ class TestPowerBidirectionChannel(TestCase): > console, msg_pipe =3D self.get_console(name) > if len(cmds) =3D=3D 0: > return > - if isinstance(cmds, (str, unicode)): > + if isinstance(cmds, str): > cmds =3D [cmds, '# ', 5] > if not isinstance(cmds[0], list): > cmds =3D [cmds] > @@ -103,10 +101,8 @@ class TestPowerBidirectionChannel(TestCase): > for item in cmds: > expected_items =3D item[1] > if expected_items and isinstance(expected_items, (list, tupl= e)): > - check_output =3D True > expected_str =3D expected_items[0] or '# ' > else: > - check_output =3D False > expected_str =3D expected_items or '# ' >=20 > try: > @@ -195,14 +191,14 @@ class TestPowerBidirectionChannel(TestCase): >=20 > # get high priority core and normal core > base_freqs_info =3D {} > - for core_index, value in cpu_info.iteritems(): > + for core_index, value in cpu_info.items(): > base_frequency =3D value.get('base_frequency') > base_freqs_info.setdefault(base_frequency, []).append(core_i= ndex) > - base_freqs =3D base_freqs_info.keys() > + base_freqs =3D list(base_freqs_info.keys()) > # cpu should have high priority core and normal core > # high priority core frequency is higher than normal core freque= ncy > if len(base_freqs) <=3D 1 or \ > - not all([len(value) for value in base_freqs_info.values()]): > + not all([len(value) for value in list(base_freqs_info.values(= ))]): > msg =3D 'current cpu has no high priority core' > raise Exception(msg) >=20 > @@ -273,15 +269,14 @@ class TestPowerBidirectionChannel(TestCase): > self.vm_power_mgr =3D self.prepare_binary('vm_power_manager') >=20 > def start_vm_power_mgr(self): > - eal_option =3D ( > - ' ' > + option =3D ( > + ' -v ' > '-c {core_mask} ' > '-n {mem_channel} ' > '--no-pci ').format(**{ > 'core_mask': self.get_cores_mask("1S/3C/1T"), > 'mem_channel': self.dut.get_memory_channels(), }) > prompt =3D 'vmpower>' > - option =3D eal_option > cmd =3D [' '.join([self.vm_power_mgr, option]), prompt, 30] > self.d_con(cmd) > self.is_mgr_on =3D True > @@ -321,7 +316,7 @@ class TestPowerBidirectionChannel(TestCase): > def start_guest_mgr(self): > prompt =3D r"vmpower\(guest\)>" > option =3D ( > - ' ' > + ' -v ' > '-c {core_mask} ' > '-n {memory_channel} ' > '-m {memory_size} ' > -- > 2.21.0