test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V2] tests/multiprocess modify the regular expression
@ 2022-08-30  8:12 Dukai Yuan
  2022-09-02  1:36 ` Tu, Lijuan
  0 siblings, 1 reply; 5+ messages in thread
From: Dukai Yuan @ 2022-08-30  8:12 UTC (permalink / raw)
  To: dts; +Cc: Dukai Yuan

Modify re.search to re.findall to get all the list.

Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 tests/TestSuite_multiprocess.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index da382a41..3d408ea9 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -175,6 +175,7 @@ class TestMultiprocess(TestCase):
                 pktnum=pkt_num,
                 dstmac="00:11:22:33:44:55",
             )
+        time.sleep(3)
         pkt.send_pkt(crb=self.tester, tx_port=self.tester_ifaces[0], count=1)
 
     def specify_packet(self, que_num):
@@ -1014,10 +1015,13 @@ class TestMultiprocess(TestCase):
                 self.logger.err("Error occured:{}".format(traceback.format_exc(e)))
             finally:
                 session_obj.close()
-        res = re.search(
-            r"Port \d+\s+-\s+rx:\s+(?P<rx>\d+)\s+tx:.*PORTS", out, re.DOTALL
+        res = re.findall(
+            r"Port \d+\s+-\s+rx:\s+\d+.*?Client\s+[1]\s+-.*?tx_drop:\s+\d+",
+            out,
+            re.DOTALL,
         )
-        rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res.group(0))
+        rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res[-1])
+
         for i in range(proc_num):
             self.verify(
                 int(rx_num[i]) > 0,
-- 
2.17.1


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

* RE: [dts][PATCH V2] tests/multiprocess modify the regular expression
  2022-08-30  8:12 [dts][PATCH V2] tests/multiprocess modify the regular expression Dukai Yuan
@ 2022-09-02  1:36 ` Tu, Lijuan
  0 siblings, 0 replies; 5+ messages in thread
From: Tu, Lijuan @ 2022-09-02  1:36 UTC (permalink / raw)
  To: Yuan, DukaiX, dts; +Cc: Yuan, DukaiX

> -----Original Message-----
> From: Dukai Yuan <dukaix.yuan@intel.com>
> Sent: Tuesday, August 30, 2022 4:13 PM
> To: dts@dpdk.org
> Cc: Yuan, DukaiX <dukaix.yuan@intel.com>
> Subject: [dts][PATCH V2] tests/multiprocess modify the regular expression
> 
> Modify re.search to re.findall to get all the list.
> 
> Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
> ---
>  tests/TestSuite_multiprocess.py | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
> index da382a41..3d408ea9 100644
> --- a/tests/TestSuite_multiprocess.py
> +++ b/tests/TestSuite_multiprocess.py
> @@ -175,6 +175,7 @@ class TestMultiprocess(TestCase):
>                  pktnum=pkt_num,
>                  dstmac="00:11:22:33:44:55",
>              )
> +        time.sleep(3)

It's not a good idea to wait 3 second, another option is to wait for the specific event which it requires.

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

* [dts][PATCH V2] tests/multiprocess modify the regular expression
  2022-10-09  6:17 Dukai Yuan
@ 2022-10-10  3:36 ` lijuan.tu
  0 siblings, 0 replies; 5+ messages in thread
From: lijuan.tu @ 2022-10-10  3:36 UTC (permalink / raw)
  To: dts, Dukai Yuan; +Cc: Dukai Yuan

On Sun,  9 Oct 2022 14:17:48 +0800, Dukai Yuan <dukaix.yuan@intel.com> wrote:
> On some NIC(I40E_10G-10G_BASE_T_X722/I40E_10G-SFP_X722/I40E_40G-QSFP_A),
> the old regular expression cannot match the expected result,	
> modify the regular expression.
> 
> Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks

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

* [dts][PATCH V2] tests/multiprocess modify the regular expression
@ 2022-10-09  6:17 Dukai Yuan
  2022-10-10  3:36 ` lijuan.tu
  0 siblings, 1 reply; 5+ messages in thread
From: Dukai Yuan @ 2022-10-09  6:17 UTC (permalink / raw)
  To: dts; +Cc: Dukai Yuan

On some NIC(I40E_10G-10G_BASE_T_X722/I40E_10G-SFP_X722/I40E_40G-QSFP_A),
the old regular expression cannot match the expected result,	
modify the regular expression.

Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 tests/TestSuite_multiprocess.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index da382a41..4fdc8c27 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -1014,10 +1014,12 @@ class TestMultiprocess(TestCase):
                 self.logger.err("Error occured:{}".format(traceback.format_exc(e)))
             finally:
                 session_obj.close()
-        res = re.search(
-            r"Port \d+\s+-\s+rx:\s+(?P<rx>\d+)\s+tx:.*PORTS", out, re.DOTALL
+        res = re.findall(
+            r"Port \d+\s+-\s+rx:\s+\d+.*?Client\s+[1]\s+-.*?tx_drop:\s+\d+",
+            out,
+            re.DOTALL,
         )
-        rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res.group(0))
+        rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res[-1])
         for i in range(proc_num):
             self.verify(
                 int(rx_num[i]) > 0,
-- 
2.17.1


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

* [dts][PATCH V2] tests/multiprocess modify the regular expression
@ 2022-10-09  5:39 Dukai Yuan
  0 siblings, 0 replies; 5+ messages in thread
From: Dukai Yuan @ 2022-10-09  5:39 UTC (permalink / raw)
  To: dts; +Cc: Dukai Yuan

On some NIC(I40E_10G-10G_BASE_T_X722/I40E_10G-SFP_X722/I40E_40G-QSFP_A),
the old regular expression cannot match the expected result,	
modify the regular expression.

Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 tests/TestSuite_multiprocess.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index da382a41..4fdc8c27 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -1014,10 +1014,12 @@ class TestMultiprocess(TestCase):
                 self.logger.err("Error occured:{}".format(traceback.format_exc(e)))
             finally:
                 session_obj.close()
-        res = re.search(
-            r"Port \d+\s+-\s+rx:\s+(?P<rx>\d+)\s+tx:.*PORTS", out, re.DOTALL
+        res = re.findall(
+            r"Port \d+\s+-\s+rx:\s+\d+.*?Client\s+[1]\s+-.*?tx_drop:\s+\d+",
+            out,
+            re.DOTALL,
         )
-        rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res.group(0))
+        rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res[-1])
         for i in range(proc_num):
             self.verify(
                 int(rx_num[i]) > 0,
-- 
2.17.1


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

end of thread, other threads:[~2022-10-10  3:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30  8:12 [dts][PATCH V2] tests/multiprocess modify the regular expression Dukai Yuan
2022-09-02  1:36 ` Tu, Lijuan
2022-10-09  5:39 Dukai Yuan
2022-10-09  6:17 Dukai Yuan
2022-10-10  3:36 ` lijuan.tu

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).