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 CC058A0C46; Wed, 9 Jun 2021 09:22:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9064040FDF; Wed, 9 Jun 2021 09:22:35 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 5542440E3C for ; Wed, 9 Jun 2021 09:22:34 +0200 (CEST) IronPort-SDR: sInAA8uaVUpUDdkf+M3AOfTIS5lv6luS2RnRkfnkzf1YM0guwNufc07MKam3F0Hl8n5UtiPrXK tdyPo0mxDnKg== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="204832407" X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="204832407" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2021 00:22:32 -0700 IronPort-SDR: RT5WYmH45nQmdqOn7qT3u8qXz+rbNWuDjUCRTovpLs3PVbccNf6TerAbY64Lhyp7NRW6TRY4mD jhab3q7C0QgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="419190277" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP; 09 Jun 2021 00:22:32 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 9 Jun 2021 00:22:31 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 9 Jun 2021 15:22:30 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2242.008; Wed, 9 Jun 2021 15:22:30 +0800 From: "Tu, Lijuan" To: dliu , "dts@dpdk.org" CC: Owen Hilyard Thread-Topic: [PATCH] Strip prompt by default in send_expect Thread-Index: AQHXMgD+IsR91QdJPUiwRkSzdjBJSasLm8MA Date: Wed, 9 Jun 2021 07:22:30 +0000 Message-ID: <88fd4d65d5044044b55e9d400c025410@intel.com> References: <20210415140933.23185-1-dliu@iol.unh.edu> In-Reply-To: <20210415140933.23185-1-dliu@iol.unh.edu> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH] Strip prompt by default in send_expect 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 Sender: "dts" > -----Original Message----- > From: dliu > Sent: 2021=1B$BG/=1B(B4=1B$B7n=1B(B15=1B$BF|=1B(B 22:10 > To: dts@dpdk.org > Cc: Tu, Lijuan ; Owen Hilyard > Subject: [PATCH] Strip prompt by default in send_expect >=20 > From: Owen Hilyard >=20 > During investigation of timeout exceptions during performance testing, th= e > community lab found that trailing whitespace in run commands was the caus= e of > some of the timeouts. This patch makes the Crb version of send_expect str= ip > whitespace from the expected string by default. It is possible to disable= this > behavior should it be needed, but we expect that the majority of use-case= s are > matching non-whitespace characters. >=20 > Signed-off-by: Owen Hilyard Applied again. Some impacted cases are fixed by http://patchwork.dpdk.org/project/dts/patc= h/20210603092151.1847-1-leweix.yang@intel.com/ > --- > framework/crb.py | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/framework/crb.py b/framework/crb.py index e7c1cc1c..3964e213 > 100644 > --- a/framework/crb.py > +++ b/framework/crb.py > @@ -79,12 +79,19 @@ class Crb(object): > self.alt_session =3D None >=20 > def send_expect(self, cmds, expected, timeout=3DTIMEOUT, > - alt_session=3DFalse, verify=3DFalse): > + alt_session=3DFalse, verify=3DFalse, trim_whitespace= =3DTrue): > """ > Send commands to crb and return string before expected string. I= f > there's no expected string found before timeout, TimeoutExceptio= n will > be raised. > + > + By default, it will trim the whitespace from the expected string= . This > + behavior can be turned off via the trim_whitespace argument. > """ > + > + if trim_whitespace: > + expected =3D expected.strip() > + > # sometimes there will be no alt_session like VM dut > if alt_session and self.alt_session: > return self.alt_session.session.send_expect(cmds, expected, > -- > 2.27.0