From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 110E0A0C43; Tue, 16 Nov 2021 07:07:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA39F40141; Tue, 16 Nov 2021 07:07:55 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id BCE5140040 for ; Tue, 16 Nov 2021 07:07:54 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="257384776" X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="257384776" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 22:07:53 -0800 X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="506284629" Received: from unknown (HELO dpdk-zhaohy-t.sh.intel.com) ([10.240.183.68]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 22:07:51 -0800 From: "Dong, JunX" 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 Message-Id: <1637042878-239212-1-git-send-email-junx.dong@intel.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org From: "Dong, JunX" Signed-off-by: Dong, JunX --- 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