test suite reviews and discussions
 help / color / mirror / Atom feed
From: <thaq@marvell.com>
To: <dts@dpdk.org>
Cc: <fmasood@marvell.com>, <avijay@marvell.com>, thaq <thaq@marvell.com>
Subject: [dts] [PATCH] TestSuite_unit_tests_pmd_perf.py:Added support to match Single socket CPU list using Regular-Expression(Regex)
Date: Tue, 23 Apr 2019 10:39:50 +0530	[thread overview]
Message-ID: <1555996190-23344-1-git-send-email-thaq@marvell.com> (raw)

From: thaq <thaq@marvell.com>

Cores listed using "/usertools/cpu_layout.py" scripts is based on the socket/cores.
Currently RE.match "match String expression" matchs only dual socket cpu list, Incase case of single socket RE.match "string" fails. So modifyed to support both the single/dual sockets cases.

Signed-off-by: thaq <thaq@marvell.com>
---
 tests/TestSuite_unit_tests_pmd_perf.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_unit_tests_pmd_perf.py b/tests/TestSuite_unit_tests_pmd_perf.py
index 6938839..0d332bf 100644
--- a/tests/TestSuite_unit_tests_pmd_perf.py
+++ b/tests/TestSuite_unit_tests_pmd_perf.py
@@ -92,11 +92,12 @@ class TestUnitTestsPmdPerf(TestCase):
     
        out = self.dut.send_expect("./usertools/cpu_layout.py", "#", 10)
        k = re.search("Core 0 (.*)", out)
-       result = re.findall("(\d+),", k.group())
        socket_id = self.dut.ports_info[0]['port'].socket
        if socket_id == 0 or socket_id == -1:
+          result = re.findall("(\d+)", k.group())
           return  int(result[0])
        else:
+          result = re.findall("(\d+),", k.group())
           return  int(result[1])
 
     def test_pmd_burst(self):
-- 
1.8.3.1


             reply	other threads:[~2019-04-23  5:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23  5:09 thaq [this message]
2019-04-23 20:40 ` Tu, Lijuan

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=1555996190-23344-1-git-send-email-thaq@marvell.com \
    --to=thaq@marvell.com \
    --cc=avijay@marvell.com \
    --cc=dts@dpdk.org \
    --cc=fmasood@marvell.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).