test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/hello_world: fix invalid_coremask when config RTE_MAX_LCORE
@ 2018-06-05  5:43 Joyce Kong
  2018-06-11  5:23 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Joyce Kong @ 2018-06-05  5:43 UTC (permalink / raw)
  To: dts; +Cc: nd, Joyce Kong

Add check for CONFIG_RTE_MAX_LCORE when getting maximum logical core
numbers

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH] tests/hello_world: fix invalid_coremask when config RTE_MAX_LCORE
  2018-06-05  5:43 [dts] [PATCH] tests/hello_world: fix invalid_coremask when config RTE_MAX_LCORE Joyce Kong
@ 2018-06-11  5:23 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2018-06-11  5:23 UTC (permalink / raw)
  To: Joyce Kong, dts; +Cc: nd

Hi Joyce,
Suggest to use regression module match or findall function to strip this number.
With the regression format, it will be more easier to get the idea about what information is needed.

Furthermore, there may be need one API defined in project_dpdk module for stripping 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 <joyce.kong@arm.com>
> Subject: [dts] [PATCH] tests/hello_world: fix invalid_coremask when config
> RTE_MAX_LCORE
> 
> Add check for CONFIG_RTE_MAX_LCORE when getting maximum logical core
> numbers
> 
> Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-11  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05  5:43 [dts] [PATCH] tests/hello_world: fix invalid_coremask when config RTE_MAX_LCORE Joyce Kong
2018-06-11  5:23 ` Liu, Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).