* [dts] [PATCH] framework: fix the sequence in time isuue
@ 2020-03-26 7:08 xinfengx
2020-03-26 7:09 ` Zhao, XinfengX
2020-03-31 3:06 ` Tu, Lijuan
0 siblings, 2 replies; 3+ messages in thread
From: xinfengx @ 2020-03-26 7:08 UTC (permalink / raw)
To: dts; +Cc: xinfengx
revert the method get_session_before
fix the issue in method send_command
Signed-off-by: xinfengx <xinfengx.zhao@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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH] framework: fix the sequence in time isuue
2020-03-26 7:08 [dts] [PATCH] framework: fix the sequence in time isuue xinfengx
@ 2020-03-26 7:09 ` Zhao, XinfengX
2020-03-31 3:06 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Zhao, XinfengX @ 2020-03-26 7:09 UTC (permalink / raw)
To: dts
Tested-by: Zhao, Xinfeng<xinfengx.zhao@intel.com>
-----Original Message-----
From: Zhao, XinfengX
Sent: Thursday, March 26, 2020 3:08 PM
To: dts@dpdk.org
Cc: Zhao, XinfengX <xinfengx.zhao@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@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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH] framework: fix the sequence in time isuue
2020-03-26 7:08 [dts] [PATCH] framework: fix the sequence in time isuue xinfengx
2020-03-26 7:09 ` Zhao, XinfengX
@ 2020-03-31 3:06 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-03-31 3:06 UTC (permalink / raw)
To: Zhao, XinfengX, dts; +Cc: Zhao, XinfengX
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xinfengx
> Sent: Thursday, March 26, 2020 3:08 PM
> To: dts@dpdk.org
> Cc: Zhao, XinfengX <xinfengx.zhao@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@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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-31 3:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 7:08 [dts] [PATCH] framework: fix the sequence in time isuue xinfengx
2020-03-26 7:09 ` Zhao, XinfengX
2020-03-31 3:06 ` 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).