test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Dong, JunX" <junx.dong@intel.com>
To: dts@dpdk.org
Cc: PingX.Yu@intel.com, weix.ling@intel.com, junx.dong@intel.com
Subject: [PATCH V1] framework/ssh_pexpect: add output buffered information when execute command exception
Date: Tue, 16 Nov 2021 14:07:58 +0800	[thread overview]
Message-ID: <1637042878-239212-1-git-send-email-junx.dong@intel.com> (raw)

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


                 reply	other threads:[~2021-11-16  6:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly 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=1637042878-239212-1-git-send-email-junx.dong@intel.com \
    --to=junx.dong@intel.com \
    --cc=PingX.Yu@intel.com \
    --cc=dts@dpdk.org \
    --cc=weix.ling@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).