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 C1FA8A057C; Thu, 26 Mar 2020 08:09:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A75451B949; Thu, 26 Mar 2020 08:09:52 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7C4D41B75C for ; Thu, 26 Mar 2020 08:09:51 +0100 (CET) IronPort-SDR: juYA3z+7SmvrcCBS3TC6j9gMFAjrkoDmfJLHi+hsFfH/13p2B00thHmZZqbMapIqKdbatQFs/3 r9213J48bsNA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2020 00:09:50 -0700 IronPort-SDR: YRW0cMxMkSxXs+YA5Ipz6EfHHU7wawv8/Nacw14ubMZ5NPD5Rz0p6UyVPGC/TeHCwj7X+gfo1f aCXEnwwyEMDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,307,1580803200"; d="scan'208";a="282400883" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 26 Mar 2020 00:09:50 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 26 Mar 2020 00:09:50 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 26 Mar 2020 15:09:48 +0800 Received: from shsmsx602.ccr.corp.intel.com ([10.109.6.142]) by SHSMSX602.ccr.corp.intel.com ([10.109.6.142]) with mapi id 15.01.1713.004; Thu, 26 Mar 2020 15:09:48 +0800 From: "Zhao, XinfengX" To: "dts@dpdk.org" Thread-Topic: [dts][PATCH] framework: fix the sequence in time isuue Thread-Index: AQHWAz1OO1uEraMF20S5QyKEqiAE7KhadGHA Date: Thu, 26 Mar 2020 07:09:48 +0000 Message-ID: References: <20200326070806.96668-1-xinfengx.zhao@intel.com> In-Reply-To: <20200326070806.96668-1-xinfengx.zhao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Tested-by: Zhao, Xinfeng -----Original Message----- From: Zhao, XinfengX=20 Sent: Thursday, March 26, 2020 3:08 PM To: dts@dpdk.org Cc: Zhao, XinfengX Subject: [dts][PATCH] framework: fix the sequence in time isuue 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 e851= cbf..fdd011d 100644 --- a/framework/ssh_pexpect.py +++ b/framework/ssh_pexpect.py @@ -98,7 +98,11 @@ class SSHPexpect: except Exception as e: raise(e) =20 - return self.get_session_before(timeout=3Dtimeout) + output =3D self.get_session_before(timeout=3Dtimeout) + self.session.PROMPT =3D self.session.UNIQUE_PROMPT + self.session.prompt(0.1) + + return output =20 def clean_session(self): self.get_session_before(timeout=3D0.01) @@ -109,11 +113,16 @@ class SSHPexpect: """ ignore_keyintr() self.session.PROMPT =3D self.magic_prompt - output =3D self.session.try_read_prompt(timeout) + try: + self.session.prompt(timeout) + except Exception as e: + pass + aware_keyintr() + before =3D self.get_output_all() self.__flush() =20 - return output + return before =20 def __flush(self): """ -- 2.17.1