* [dts][PATCH V1] tests/multiprocess modify the regular expression
@ 2022-08-30 7:43 Dukai Yuan
0 siblings, 0 replies; 2+ messages in thread
From: Dukai Yuan @ 2022-08-30 7:43 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 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index da382a41..9817c9c7 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,10 @@ 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] 2+ messages in thread
* [dts][PATCH V1] tests/multiprocess modify the regular expression
@ 2022-08-29 9:44 Dukai Yuan
0 siblings, 0 replies; 2+ messages in thread
From: Dukai Yuan @ 2022-08-29 9:44 UTC (permalink / raw)
To: dts; +Cc: Dukai Yuan
I40E_10G-SFP_XL710/I40E_10G-10G_BASE_T_X722/IGC-I226_LM use re.search,return (0, 0).
Use re.findall will right.
Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
---
tests/TestSuite_multiprocess.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index da382a41..7cbf64c2 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -1014,10 +1014,10 @@ 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] 2+ messages in thread
end of thread, other threads:[~2022-08-30 7:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 7:43 [dts][PATCH V1] tests/multiprocess modify the regular expression Dukai Yuan
-- strict thread matches above, loose matches on Subject: below --
2022-08-29 9:44 Dukai Yuan
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).