From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id ABCB11E44B for ; Mon, 11 Jun 2018 07:23:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2018 22:23:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,500,1520924400"; d="scan'208";a="62071047" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 10 Jun 2018 22:23:53 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 10 Jun 2018 22:23:53 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 10 Jun 2018 22:23:53 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.82]) with mapi id 14.03.0319.002; Mon, 11 Jun 2018 13:23:51 +0800 From: "Liu, Yong" To: Joyce Kong , "dts@dpdk.org" CC: "nd@arm.com" Thread-Topic: [dts] [PATCH] tests/hello_world: fix invalid_coremask when config RTE_MAX_LCORE Thread-Index: AQHT/JAv4Sq0G7k3PUqxJTMs7/F2taRajoJQ Date: Mon, 11 Jun 2018 05:23:51 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E630C175F@SHSMSX103.ccr.corp.intel.com> References: <1528177403-27939-1-git-send-email-joyce.kong@arm.com> In-Reply-To: <1528177403-27939-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGNiYzc4ODAtNDBmMC00N2ZiLWIzMDAtZDEwZWFiNDhmZjE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibGNSWHJnc3owWWYyUWFHU0crWnB4RUZ2dkZ0Sm41Wk5wU0xNMWJDYzIwbmtxbUowTjhDekgzcGpWRlJ3UkpjcCJ9 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] tests/hello_world: fix invalid_coremask when config RTE_MAX_LCORE 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: Mon, 11 Jun 2018 05:23:56 -0000 Hi Joyce, Suggest to use regression module match or findall function to strip this nu= mber. With the regression format, it will be more easier to get the idea about wh= at information is needed. Furthermore, there may be need one API defined in project_dpdk module for s= tripping or modifying dpdk configurations. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Joyce Kong > Sent: Tuesday, June 05, 2018 1:43 PM > To: dts@dpdk.org > Cc: nd@arm.com; Joyce Kong > Subject: [dts] [PATCH] tests/hello_world: fix invalid_coremask when confi= g > RTE_MAX_LCORE >=20 > Add check for CONFIG_RTE_MAX_LCORE when getting maximum logical core > numbers >=20 > Signed-off-by: Joyce Kong > --- > tests/TestSuite_hello_world.py | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/TestSuite_hello_world.py > b/tests/TestSuite_hello_world.py > index 1c5934c..7227e13 100644 > --- a/tests/TestSuite_hello_world.py > +++ b/tests/TestSuite_hello_world.py > @@ -78,11 +78,24 @@ class TestHelloWorld(TestCase): >=20 > # get the maximun logical core number > cores =3D self.dut.get_core_list('all') > - coreMask =3D utils.create_mask(cores) > + > + out =3D self.dut.send_expect("cat config/defconfig_%s" % > self.target, "]# ", 10) > + start_position =3D out.find('CONFIG_RTE_MAX_LCORE=3D') > + > + if start_position > -1: > + if out.find('\n', start_position) > -1: > + end_position =3D out.find('\n', start_position) > + else: > + end_position =3D len(out) > + available_max_lcore =3D int(out[start_position + > 21:end_position]) > + else: > + available_max_lcore =3D len(cores) + 1 > + > + coreMask =3D utils.create_mask(cores[:available_max_lcore - 1]) >=20 > cmdline =3D "./examples/helloworld/build/app/helloworld -n 1 -c = " + > coreMask > out =3D self.dut.send_expect(cmdline, "# ", 50) > - for i in range(len(cores)): > + for i in range(available_max_lcore - 1): > self.verify("hello from core %s" % cores[i] in out, "EAL not > started on core%s" % cores[i]) >=20 > def tear_down(self): > -- > 1.8.3.1