From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 8E6B01B416 for ; Tue, 5 Jun 2018 07:43:33 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F8801596; Mon, 4 Jun 2018 22:43:32 -0700 (PDT) Received: from net-x86-lenovo_01.shanghai.arm.com (lenovo-a010984.shanghai.arm.com [10.169.40.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0E3F03F5A0; Mon, 4 Jun 2018 22:43:31 -0700 (PDT) From: Joyce Kong To: dts@dpdk.org Cc: nd@arm.com, Joyce Kong Date: Tue, 5 Jun 2018 13:43:23 +0800 Message-Id: <1528177403-27939-1-git-send-email-joyce.kong@arm.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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: Tue, 05 Jun 2018 05:43:33 -0000 Add check for CONFIG_RTE_MAX_LCORE when getting maximum logical core numbers Signed-off-by: Joyce Kong --- tests/TestSuite_hello_world.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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): # get the maximun logical core number cores = self.dut.get_core_list('all') - coreMask = utils.create_mask(cores) + + out = self.dut.send_expect("cat config/defconfig_%s" % self.target, "]# ", 10) + start_position = out.find('CONFIG_RTE_MAX_LCORE=') + + if start_position > -1: + if out.find('\n', start_position) > -1: + end_position = out.find('\n', start_position) + else: + end_position = len(out) + available_max_lcore = int(out[start_position + 21:end_position]) + else: + available_max_lcore = len(cores) + 1 + + coreMask = utils.create_mask(cores[:available_max_lcore - 1]) cmdline = "./examples/helloworld/build/app/helloworld -n 1 -c " + coreMask out = 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]) def tear_down(self): -- 1.8.3.1