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 B7EC6A0562; Tue, 31 Mar 2020 05:06:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B083A1C0AB; Tue, 31 Mar 2020 05:06:29 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7CCEC2B8B for ; Tue, 31 Mar 2020 05:06:27 +0200 (CEST) IronPort-SDR: rykKXMPHwkqceRkuZ+dxpccnIycqpAkWWeNIfK8QQ6KcPLSUCbK1WMSWdASSfxPw1hs+s8nHyx FVgRl+1H0KVg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 20:06:26 -0700 IronPort-SDR: WSaqg9MtZRd6WkHeZZfUOIvSHlYJCy8DBxDR3EKY/824k/oxRksEuLC/5iccHIUhxGsEPTLgin mOcUI1xFDTgg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,326,1580803200"; d="scan'208";a="241800123" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 30 Mar 2020 20:06:26 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 20:06:26 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 30 Mar 2020 20:06:26 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Tue, 31 Mar 2020 11:06:24 +0800 From: "Tu, Lijuan" To: "Zhao, XinfengX" , "dts@dpdk.org" CC: "Zhao, XinfengX" Thread-Topic: [dts] [PATCH] framework: fix the sequence in time isuue Thread-Index: AQHWAz1YCGaQhJkSREu3CpY0g7jnDKhiDDmg Date: Tue, 31 Mar 2020 03:06:23 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC03537@SHSMSX101.ccr.corp.intel.com> References: <20200326070806.96668-1-xinfengx.zhao@intel.com> In-Reply-To: <20200326070806.96668-1-xinfengx.zhao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xinfengx > 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 >=20 > revert the method get_session_before > fix the issue in method send_command >=20 > Signed-off-by: xinfengx > --- > framework/ssh_pexpect.py | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) >=20 > 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) >=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