From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7B0B01B45C for ; Wed, 20 Jun 2018 10:02:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2018 01:02:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,246,1526367600"; d="scan'208";a="60720754" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 20 Jun 2018 01:02:39 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 20 Jun 2018 01:02:39 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 20 Jun 2018 01:02:38 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Wed, 20 Jun 2018 16:02:37 +0800 From: "Liu, Yong" To: Joyce Kong , "dts@dpdk.org" CC: "phil.yang@arm.com" Thread-Topic: [dts] [PATCH 1/3] framework/project_dpdk: add API to get def_rte_config value Thread-Index: AQHUB71NQpugAC/7mUuCF4HMjsXgo6RoyKFw Date: Wed, 20 Jun 2018 08:02:37 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E630C6FA9@SHSMSX103.ccr.corp.intel.com> References: <1529406238-13393-1-git-send-email-joyce.kong@arm.com> In-Reply-To: <1529406238-13393-1-git-send-email-joyce.kong@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmE3MjI2ZjgtYThlYS00OWVmLTgwNzctYTFkMzE4MTkwYTZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRGlOd01cL1hOWnVBMmRidERuZElBR0pURzBsQ1p2RytNS2Z4dVp6ZTh1K2YwKzl6UUN2aTc5b1JoNXZac1NEcWUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 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 1/3] framework/project_dpdk: add API to get def_rte_config value 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: , X-List-Received-Date: Wed, 20 Jun 2018 08:02:55 -0000 Thanks, Joyce. Some comments are inline. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Joyce Kong > Sent: Tuesday, June 19, 2018 7:04 PM > To: dts@dpdk.org > Cc: phil.yang@arm.com; Joyce Kong > Subject: [dts] [PATCH 1/3] framework/project_dpdk: add API to get > def_rte_config value >=20 > Add get_def_rte_config API to get RTE configuration from > config/defconfig_*. >=20 > Signed-off-by: Joyce Kong > Reviewed-by: Phil Yang > --- > framework/project_dpdk.py | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py > index f87fd13..1006d4f 100644 > --- a/framework/project_dpdk.py > +++ b/framework/project_dpdk.py > @@ -430,6 +430,21 @@ class DPDKdut(Dut): > # No blacklist option in FreeBSD > return blacklist >=20 > + def get_def_rte_config(self, config): > + """ > + Get RTE configuration from config/defconfig_*. > + """ > + out =3D self.send_expect("cat config/defconfig_%s" % self.target= , > "]# ", 10) > + Please replace send_expect with send_command, as any kind of string may exi= sting in configuration file. Suggest to add sed filter which can remove commented lines. "cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'" > + def_rte_config =3D re.findall(config+'=3D(\S+)', out) > + if def_rte_config: > + if re.match(r'\d+', def_rte_config[0]): > + return int(def_rte_config[0]) > + else: > + return def_rte_config[0] Suggest not handle integer here, can leave it to test case.=20 > + > + return None > + > def set_driver_specific_configurations(self, drivername): > """ > Set configurations required for specific drivers before > compilation. > -- > 1.8.3.1