[dts] [PATCH] TestSuite_unit_tests_pmd_perf.py:Added support to match Single socket CPU list using Regular-Expression(Regex)

Tu, Lijuan lijuan.tu at intel.com
Tue Apr 23 22:40:12 CEST 2019


Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of thaq at marvell.com
> Sent: Monday, April 22, 2019 10:10 PM
> To: dts at dpdk.org
> Cc: fmasood at marvell.com; avijay at marvell.com; thaq <thaq at marvell.com>
> Subject: [dts] [PATCH] TestSuite_unit_tests_pmd_perf.py:Added support to
> match Single socket CPU list using Regular-Expression(Regex)
> 
> From: thaq <thaq at 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 at 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



More information about the dts mailing list