[dts] [PATCH] framework: fix the sequence in time isuue

Zhao, XinfengX xinfengx.zhao at intel.com
Thu Mar 26 08:09:48 CET 2020


Tested-by:  Zhao, Xinfeng<xinfengx.zhao at intel.com>

-----Original Message-----
From: Zhao, XinfengX 
Sent: Thursday, March 26, 2020 3:08 PM
To: dts at dpdk.org
Cc: Zhao, XinfengX <xinfengx.zhao at intel.com>
Subject: [dts][PATCH] framework: fix the sequence in time isuue

revert the method get_session_before
fix the issue in method send_command

Signed-off-by: xinfengx <xinfengx.zhao at intel.com>
---
 framework/ssh_pexpect.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py index e851cbf..fdd011d 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -98,7 +98,11 @@ class SSHPexpect:
         except Exception as e:
             raise(e)
 
-        return self.get_session_before(timeout=timeout)
+        output =  self.get_session_before(timeout=timeout)
+        self.session.PROMPT = self.session.UNIQUE_PROMPT
+        self.session.prompt(0.1)
+
+        return output
 
     def clean_session(self):
         self.get_session_before(timeout=0.01)
@@ -109,11 +113,16 @@ class SSHPexpect:
         """
         ignore_keyintr()
         self.session.PROMPT = self.magic_prompt
-        output = self.session.try_read_prompt(timeout)
+        try:
+            self.session.prompt(timeout)
+        except Exception as e:
+            pass
+
         aware_keyintr()
+        before = self.get_output_all()
         self.__flush()
 
-        return output
+        return before
 
     def __flush(self):
         """
--
2.17.1



More information about the dts mailing list