test suite reviews and discussions
 help / color / Atom feed
From: xinfengx <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: xinfengx <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH] framework: fix the sequence in time isuue
Date: Thu, 26 Mar 2020 15:08:06 +0800
Message-ID: <20200326070806.96668-1-xinfengx.zhao@intel.com> (raw)

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


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  7:08 xinfengx [this message]
2020-03-26  7:09 ` Zhao, XinfengX
2020-03-31  3:06 ` Tu, Lijuan

Reply instructions:

You may reply publically 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=20200326070806.96668-1-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox