[dts] [PATCH 2/3] tests/hello_world: fix invalid coremask when config RTE_MAX_LCORE

Joyce Kong joyce.kong at arm.com
Tue Jun 19 13:03:57 CEST 2018


Add check for CONFIG_RTE_MAX_LCORE when getting maximum logical core
numbers.

Signed-off-by: Joyce Kong <joyce.kong at arm.com>
Reviewed-by: Phil Yang <phil.yang at arm.com>
---
 tests/TestSuite_hello_world.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_hello_world.py b/tests/TestSuite_hello_world.py
index 1c5934c..a81b82e 100644
--- a/tests/TestSuite_hello_world.py
+++ b/tests/TestSuite_hello_world.py
@@ -78,11 +78,18 @@ class TestHelloWorld(TestCase):
 
         # get the maximun logical core number
         cores = self.dut.get_core_list('all')
-        coreMask = utils.create_mask(cores)
+
+        config_max_lcore = self.dut.get_def_rte_config('CONFIG_RTE_MAX_LCORE')
+        if config_max_lcore:
+            available_max_lcore = config_max_lcore
+        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



More information about the dts mailing list