From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5F077A057C; Thu, 26 Mar 2020 08:08:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5283B1B949; Thu, 26 Mar 2020 08:08:02 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id E48F61B75C for ; Thu, 26 Mar 2020 08:08:00 +0100 (CET) IronPort-SDR: SRiMEKiUD3ixBd/t4m7LPZOv9pXIkeBx49fkbGPnEg1iacQhyPHoftrjjxZ9L8wIzBRrxDouln C4u7n3dmRXcA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2020 00:08:00 -0700 IronPort-SDR: Z9sDziaPMSVRT70neSf5iG7/doM9LMLLoqTb5wEVHgJgCcHxA+uS33lZmyWDkQn8nzXp9HBlhN S5Tq50CPtOPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,307,1580803200"; d="scan'208";a="271070731" Received: from unknown (HELO dpdk-xinfengx-dut.sh.intel.com) ([10.67.117.16]) by fmsmga004.fm.intel.com with ESMTP; 26 Mar 2020 00:07:58 -0700 From: xinfengx To: dts@dpdk.org Cc: xinfengx Date: Thu, 26 Mar 2020 15:08:06 +0800 Message-Id: <20200326070806.96668-1-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH] framework: fix the sequence in time isuue X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" revert the method get_session_before fix the issue in method send_command Signed-off-by: xinfengx --- 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