test suite reviews and discussions
 help / color / mirror / Atom feed
From: Joyce Kong <joyce.kong@arm.com>
To: dts@dpdk.org
Cc: phil.yang@arm.com, Joyce Kong <joyce.kong@arm.com>
Subject: [dts] [PATCH V3 2/3] tests/hello_world: fix invalid coremask when config RTE_MAX_LCORE
Date: Wed, 20 Jun 2018 17:14:03 +0800	[thread overview]
Message-ID: <1529486044-16365-2-git-send-email-joyce.kong@arm.com> (raw)
In-Reply-To: <1529486044-16365-1-git-send-email-joyce.kong@arm.com>

Add check for CONFIG_RTE_MAX_LCORE when getting maximum logical core
numbers.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@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..5b962e2 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 = int(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

  reply	other threads:[~2018-06-20  9:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20  9:14 [dts] [PATCH V3 1/3] framework/project_dpdk: add API to get def_rte_config value Joyce Kong
2018-06-20  9:14 ` Joyce Kong [this message]
2018-06-20  9:14 ` [dts] [PATCH V3 3/3] tests/coremask: fix invalid coremask when config RTE_MAX_LCORE Joyce Kong
2018-06-22 13:13 ` [dts] [PATCH V3 1/3] framework/project_dpdk: add API to get def_rte_config value Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529486044-16365-2-git-send-email-joyce.kong@arm.com \
    --to=joyce.kong@arm.com \
    --cc=dts@dpdk.org \
    --cc=phil.yang@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).