* [dts] [PATCH V1] framework: update code about ixia to support py3
@ 2020-01-16 23:20 lihong
2020-01-17 6:55 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: lihong @ 2020-01-16 23:20 UTC (permalink / raw)
To: dts; +Cc: lihong
Signed-off-by: lihong <lihongx.ma@intel.com>
---
framework/etgen.py | 16 ++++++++--------
framework/pktgen_ixia.py | 14 +++++++-------
2 files changed, 15 insertions(+), 15 deletions(-)
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 = self.send_expect("set chasId [ixGetChassisID %s]" % self.tclServerIP, "% ")
self.chasId = int(out.strip())
- out = self.send_expect("ixClearOwnership [list %s]" % string.join(
- ['[list %d %d %d]' % (self.chasId, item['card'], item['port']) for item in self.ports], ' '), "% ", 10)
+ out = 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] != '0':
return False
- out = self.send_expect("ixTakeOwnership [list %s] force" % string.join(
- ['[list %d %d %d]' % (self.chasId, item['card'], item['port']) for item in self.ports], ' '), "% ", 10)
+ out = 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] != '0':
return False
@@ -464,7 +464,7 @@ class IxiaPacketGenerator(SSHConnection):
pl.append('[list %d %d %d]' % (self.chasId, item['card'], item['port']))
- self.add_tcl_cmd("set portList [list %s]" % string.join(pl, ' '))
+ self.add_tcl_cmd("set portList [list %s]" % ' '.join(pl))
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]))
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)
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 = int(out.strip())
- out = self.send_expect("ixClearOwnership [list %s]" % string.join(
+ out = 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] != '0':
return False
- out = self.send_expect("ixTakeOwnership [list %s] force" % string.join(
+ out = 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] != '0':
return False
@@ -644,7 +644,7 @@ class Ixia(SSHConnection):
pl.append('[list %d %d %d]' % (
self.chasId, item['card'], item['port']))
- self.add_tcl_cmd("set portList [list %s]" % string.join(pl, ' '))
+ self.add_tcl_cmd("set portList [list %s]" % ' '.join(pl))
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 pList], ' '))
+ ' '.join(['[list %s]' % ixia_port for ixia_port in pList]))
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V1] framework: update code about ixia to support py3
2020-01-16 23:20 [dts] [PATCH V1] framework: update code about ixia to support py3 lihong
@ 2020-01-17 6:55 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-01-17 6:55 UTC (permalink / raw)
To: Ma, LihongX, dts; +Cc: Ma, LihongX
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 <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V1] framework: update code about ixia to support py3
>
> Signed-off-by: lihong <lihongx.ma@intel.com>
> ---
> framework/etgen.py | 16 ++++++++--------
> framework/pktgen_ixia.py | 14 +++++++-------
> 2 files changed, 15 insertions(+), 15 deletions(-)
>
> 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 = self.send_expect("set chasId [ixGetChassisID %s]" %
> self.tclServerIP, "% ")
> self.chasId = int(out.strip())
>
> - out = self.send_expect("ixClearOwnership [list %s]" % string.join(
> - ['[list %d %d %d]' % (self.chasId, item['card'], item['port']) for item in
> self.ports], ' '), "% ", 10)
> + out = 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] != '0':
> return False
> - out = self.send_expect("ixTakeOwnership [list %s] force" % string.join(
> - ['[list %d %d %d]' % (self.chasId, item['card'], item['port']) for item in
> self.ports], ' '), "% ", 10)
> + out = 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] != '0':
> return False
>
> @@ -464,7 +464,7 @@ class IxiaPacketGenerator(SSHConnection):
>
> pl.append('[list %d %d %d]' % (self.chasId, item['card'], item['port']))
>
> - self.add_tcl_cmd("set portList [list %s]" % string.join(pl, ' '))
> + self.add_tcl_cmd("set portList [list %s]" % ' '.join(pl))
>
> 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]))
>
> 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)
>
> 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 = int(out.strip())
>
> - out = self.send_expect("ixClearOwnership [list %s]" % string.join(
> + out = 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] != '0':
> return False
> - out = self.send_expect("ixTakeOwnership [list %s] force" % string.join(
> + out = 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] != '0':
> return False
> @@ -644,7 +644,7 @@ class Ixia(SSHConnection):
> pl.append('[list %d %d %d]' % (
> self.chasId, item['card'], item['port']))
>
> - self.add_tcl_cmd("set portList [list %s]" % string.join(pl, ' '))
> + self.add_tcl_cmd("set portList [list %s]" % ' '.join(pl))
>
> 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 pList], ' '))
> + ' '.join(['[list %s]' % ixia_port for ixia_port in
> + pList]))
>
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-17 6:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 23:20 [dts] [PATCH V1] framework: update code about ixia to support py3 lihong
2020-01-17 6:55 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).