test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH V1] framework/ssh_pexpect: add output buffered information when execute command exception
@ 2021-11-16  6:07 Dong, JunX
  0 siblings, 0 replies; only message in thread
From: Dong, JunX @ 2021-11-16  6:07 UTC (permalink / raw)
  To: dts; +Cc: PingX.Yu, weix.ling, junx.dong

From: "Dong, JunX" <junx.dong@intel.com>

Signed-off-by: Dong, JunX <junx.dong@intel.com>
---
 framework/ssh_pexpect.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index 783f989..a9331d5 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -87,7 +87,7 @@ class SSHPexpect:
         return before
 
     def send_expect(self, command, expected, timeout=15, verify=False):
-
+        buffered_info = self.get_session_before(timeout=0)
         try:
             ret = self.send_expect_base(command, expected, timeout)
             if verify:
@@ -96,11 +96,13 @@ class SSHPexpect:
                     return ret
                 else:
                     self.logger.error("Command: %s failure!" % command)
+                    self.logger.error('Buffered info: ' + buffered_info)
                     self.logger.error(ret)
                     return int(ret_status)
             else:
                 return ret
         except Exception as e:
+            self.logger.error('Buffered info: ' + buffered_info)
             print(RED("Exception happened in [%s] and output is [%s]" % (command, self.get_output_before())))
             raise(e)
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-16  6:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16  6:07 [PATCH V1] framework/ssh_pexpect: add output buffered information when execute command exception Dong, JunX

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	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

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


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