test suite reviews and discussions
 help / color / mirror / Atom feed
From: lihong <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: lihong <lihongx.ma@intel.com>
Subject: [dts] [PATCH V1] framework: update code about ixia to support py3
Date: Fri, 17 Jan 2020 07:20:11 +0800	[thread overview]
Message-ID: <1579216811-12343-1-git-send-email-lihongx.ma@intel.com> (raw)

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


             reply	other threads:[~2020-01-17  6:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 23:20 lihong [this message]
2020-01-17  6:55 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1579216811-12343-1-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).