pktgen_ixia: fix a issue taking ownership failed

Message ID 1621288016-63122-1-git-send-email-lijuan.tu@intel.com (mailing list archive)
State Accepted
Headers
Series pktgen_ixia: fix a issue taking ownership failed |

Commit Message

Tu, Lijuan May 17, 2021, 9:46 p.m. UTC
  DTS has to take ownership of an ixia port, then can operate it.
If the port is owned by other user, DTS has to take ownership forcedly.
It seems DTS intend to do above but with wrong code implement.

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
---
 framework/pktgen_ixia.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Tu, Lijuan May 26, 2021, 6:24 a.m. UTC | #1
> DTS has to take ownership of an ixia port, then can operate it.
> If the port is owned by other user, DTS has to take ownership forcedly.
> It seems DTS intend to do above but with wrong code implement.
> 
> Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>

Applied
  

Patch

diff --git a/framework/pktgen_ixia.py b/framework/pktgen_ixia.py
index 80c5cb5..0273f3a 100644
--- a/framework/pktgen_ixia.py
+++ b/framework/pktgen_ixia.py
@@ -610,13 +610,13 @@  class Ixia(SSHConnection):
                 for item in self.ports]),
             "% ", 10)
         if out.strip()[-1] != '0':
-            return False
-        out = self.send_expect("ixTakeOwnership [list %s] force" % ' '.join(
+            self.logger.info("Force to take ownership:")
+            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
+            if out.strip()[-1] != '0':
+                return False
 
         return True