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 86B9CA051A; Fri, 17 Jan 2020 07:56:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7465A1C43A; Fri, 17 Jan 2020 07:56:21 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1D74B1C436 for ; Fri, 17 Jan 2020 07:56:19 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2020 22:56:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,329,1574150400"; d="scan'208";a="274276528" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jan 2020 22:56:18 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jan 2020 22:55:23 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jan 2020 22:55:22 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0439.000; Fri, 17 Jan 2020 14:55:21 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] framework: update code about ixia to support py3 Thread-Index: AQHVzQIBNP+CfuxbjkioN7y8apvEzafubB2A Date: Fri, 17 Jan 2020 06:55:20 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBAC938@SHSMSX101.ccr.corp.intel.com> References: <1579216811-12343-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1579216811-12343-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] framework: update code about ixia to support py3 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 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Friday, January 17, 2020 7:20 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] framework: update code about ixia to support py= 3 >=20 > Signed-off-by: lihong > --- > framework/etgen.py | 16 ++++++++-------- > framework/pktgen_ixia.py | 14 +++++++------- > 2 files changed, 15 insertions(+), 15 deletions(-) >=20 > diff --git a/framework/etgen.py b/framework/etgen.py index > 5fa1a66..0ffe7b4 100644 > --- a/framework/etgen.py > +++ b/framework/etgen.py > @@ -427,12 +427,12 @@ class IxiaPacketGenerator(SSHConnection): > out =3D self.send_expect("set chasId [ixGetChassisID %s]" % > self.tclServerIP, "% ") > self.chasId =3D int(out.strip()) >=20 > - out =3D self.send_expect("ixClearOwnership [list %s]" % string.j= oin( > - ['[list %d %d %d]' % (self.chasId, item['card'], item['port'= ]) for item in > self.ports], ' '), "% ", 10) > + out =3D self.send_expect("ixClearOwnership [list %s]" % ' '.join= ( > + ['[list %d %d %d]' % (self.chasId, item['card'], > + item['port']) for item in self.ports]), "% ", 10) > if out.strip()[-1] !=3D '0': > return False > - out =3D self.send_expect("ixTakeOwnership [list %s] force" % str= ing.join( > - ['[list %d %d %d]' % (self.chasId, item['card'], item['port'= ]) for item in > self.ports], ' '), "% ", 10) > + out =3D self.send_expect("ixTakeOwnership [list %s] force" % ' '= .join( > + ['[list %d %d %d]' % (self.chasId, item['card'], > + item['port']) for item in self.ports]), "% ", 10) > if out.strip()[-1] !=3D '0': > return False >=20 > @@ -464,7 +464,7 @@ class IxiaPacketGenerator(SSHConnection): >=20 > pl.append('[list %d %d %d]' % (self.chasId, item['card'], it= em['port'])) >=20 > - self.add_tcl_cmd("set portList [list %s]" % string.join(pl, ' ')= ) > + self.add_tcl_cmd("set portList [list %s]" % ' '.join(pl)) >=20 > self.add_tcl_cmd("ixClearTimeStamp portList") > self.add_tcl_cmd("ixWritePortsToHardware portList") @@ -475,8 > +475,8 @@ class IxiaPacketGenerator(SSHConnection): > Implement ports/streams configuration on specified ports. > """ > self.add_tcl_cmd("set portList [list %s]" % > - string.join(['[list %d %d %d]' % > - (self.chasId, item['card'], item['= port']) for item in pList], > ' ')) > + ' '.join(['[list %d %d %d]' % > + (self.chasId, item['card'], > + item['port']) for item in pList])) >=20 > def send_ping6(self, pci, mac, ipv6): > """ > @@ -726,7 +726,7 @@ class IxiaPacketGenerator(SSHConnection): > Configure Ixia for DCB. > """ > self.send_expect("source ./ixTcl1.0/ixiaDCB.tcl", "% ") > - self.send_expect("configIxia %d %s" % (self.chasId, string.join(= ["%s" % ( > + self.send_expect("configIxia %d %s" % (self.chasId, ' > + '.join(["%s" % ( > repr(self.conRelation[port][n])) for port in [rxPort, txPort= ] for n in > range(3)])), "% ", 100) >=20 > def config_port_dcb(self, direction, tc): > diff --git a/framework/pktgen_ixia.py b/framework/pktgen_ixia.py index > f245d6d..937e219 100644 > --- a/framework/pktgen_ixia.py > +++ b/framework/pktgen_ixia.py > @@ -600,15 +600,15 @@ class Ixia(SSHConnection): > "set chasId [ixGetChassisID %s]" % self.tclServerIP,= "% ") > self.chasId =3D int(out.strip()) >=20 > - out =3D self.send_expect("ixClearOwnership [list %s]" % string.j= oin( > + out =3D self.send_expect("ixClearOwnership [list %s]" % ' '.join= ( > ['[list %d %d %d]' % (self.chasId, item['card'], item['port'= ]) > - for item in self.ports], ' '), > + for item in self.ports]), > "% ", 10) > if out.strip()[-1] !=3D '0': > return False > - out =3D self.send_expect("ixTakeOwnership [list %s] force" % str= ing.join( > + out =3D self.send_expect("ixTakeOwnership [list %s] force" % ' > + '.join( > ['[list %d %d %d]' % (self.chasId, item['card'], item['port'= ]) > - for item in self.ports], ' '), > + for item in self.ports]), > "% ", 10) > if out.strip()[-1] !=3D '0': > return False > @@ -644,7 +644,7 @@ class Ixia(SSHConnection): > pl.append('[list %d %d %d]' % ( > self.chasId, item['card'], item['= port'])) >=20 > - self.add_tcl_cmd("set portList [list %s]" % string.join(pl, ' ')= ) > + self.add_tcl_cmd("set portList [list %s]" % ' '.join(pl)) >=20 > self.add_tcl_cmd("ixClearTimeStamp portList") > self.add_tcl_cmd("ixWritePortsToHardware portList") @@ -655,7 > +655,7 @@ class Ixia(SSHConnection): > Implement ports/streams configuration on specified ports. > """ > self.add_tcl_cmd("set portList [list %s]" % > - string.join(['[list %s]' % ixia_port for ixia_port in pL= ist], ' ')) > + ' '.join(['[list %s]' % ixia_port for ixia_port in > + pList])) >=20 > def send_ping6(self, pci, mac, ipv6): > """ > @@ -961,7 +961,7 @@ class Ixia(SSHConnection): > self.send_expect("source ./ixTcl1.0/ixiaDCB.tcl", "% ") > self.send_expect("configIxia %d %s" % ( > self.chasId, > - string.join(["%s" % ( > + ' '.join(["%s" % ( > repr(self.conRelation[port][n])) > for port in [rxPort, txPort] > for n in range(3)])), > -- > 2.7.4