* [dts] [PATCH V1] tests/vf kernel : change regex match
@ 2018-11-16 2:16 zhao,meijuan
2018-11-16 7:49 ` Zhao, MeijuanX
0 siblings, 1 reply; 2+ messages in thread
From: zhao,meijuan @ 2018-11-16 2:16 UTC (permalink / raw)
To: dts; +Cc: zhao,meijuan
Change regex for interface statistic. Should support different kinds
of NICs and total number is the summary of all queues
for ixgbevf,ethtool -S eth0:
NIC statistics:
rx_packets: 0
tx_packets: 8
for i40evf, ethtool -S eth0:
NIC statistics:
rx-0.packets: 0
rx-1.packets: 0
Signed-off-by: zhao,meijuan <meijuanx.zhao@intel.com>
---
tests/TestSuite_vf_kernel.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/TestSuite_vf_kernel.py b/tests/TestSuite_vf_kernel.py
index 06ca013..649fc0a 100644
--- a/tests/TestSuite_vf_kernel.py
+++ b/tests/TestSuite_vf_kernel.py
@@ -450,7 +450,8 @@ class TestVfKernel(TestCase):
"""
time.sleep(10)
out = self.vm0_dut.send_expect("ethtool -S %s" % self.vm0_intf0, "#")
- rx_packets_before = re.findall("\s*rx.*\d+.*packets:\s*(\d*)", out)
+ pattern = "\s*rx.*packets:\s*(\d*)"
+ rx_packets_before = re.findall(pattern, out)
nb_rx_pkts_before = 0
for i in range(len(rx_packets_before)):
nb_rx_pkts_before += int(rx_packets_before[i])
@@ -460,7 +461,7 @@ class TestVfKernel(TestCase):
vm0_vf0_mac, num=10), "VM reveive packet failed")
out = self.vm0_dut.send_expect("ethtool -S %s" % self.vm0_intf0, "#")
- rx_packets_after = re.findall("\s*rx.*\d+.*packets:\s*(\d*)", out)
+ rx_packets_after = re.findall(pattern, out)
nb_rx_pkts_after = 0
for i in range(len(rx_packets_after)):
nb_rx_pkts_after += int(rx_packets_after[i])
--
2.17.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V1] tests/vf kernel : change regex match
2018-11-16 2:16 [dts] [PATCH V1] tests/vf kernel : change regex match zhao,meijuan
@ 2018-11-16 7:49 ` Zhao, MeijuanX
0 siblings, 0 replies; 2+ messages in thread
From: Zhao, MeijuanX @ 2018-11-16 7:49 UTC (permalink / raw)
To: dts; +Cc: Zhao, MeijuanX
For old ixgbevf(eg: 2.11.3-k) , ethtool -S eth0 :
NIC statistics:
rx_packets: 0
tx_packets: 0
for now ixgbevf(eg: 3.2.2), ethtool -S eth0:
rx_queue_0_packets: 0
rx_queue_1_packets: 0
due to we use new ixgbevf, don't need to merge
-----Original Message-----
From: Zhao, MeijuanX
Sent: Friday, November 16, 2018 10:16 AM
To: dts@dpdk.org
Cc: Zhao, MeijuanX <meijuanx.zhao@intel.com>
Subject: [dts][PATCH V1] tests/vf kernel : change regex match
Change regex for interface statistic. Should support different kinds of NICs and total number is the summary of all queues
for ixgbevf,ethtool -S eth0:
NIC statistics:
rx_packets: 0
tx_packets: 8
for i40evf, ethtool -S eth0:
NIC statistics:
rx-0.packets: 0
rx-1.packets: 0
Signed-off-by: zhao,meijuan <meijuanx.zhao@intel.com>
---
tests/TestSuite_vf_kernel.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/TestSuite_vf_kernel.py b/tests/TestSuite_vf_kernel.py index 06ca013..649fc0a 100644
--- a/tests/TestSuite_vf_kernel.py
+++ b/tests/TestSuite_vf_kernel.py
@@ -450,7 +450,8 @@ class TestVfKernel(TestCase):
"""
time.sleep(10)
out = self.vm0_dut.send_expect("ethtool -S %s" % self.vm0_intf0, "#")
- rx_packets_before = re.findall("\s*rx.*\d+.*packets:\s*(\d*)", out)
+ pattern = "\s*rx.*packets:\s*(\d*)"
+ rx_packets_before = re.findall(pattern, out)
nb_rx_pkts_before = 0
for i in range(len(rx_packets_before)):
nb_rx_pkts_before += int(rx_packets_before[i]) @@ -460,7 +461,7 @@ class TestVfKernel(TestCase):
vm0_vf0_mac, num=10), "VM reveive packet failed")
out = self.vm0_dut.send_expect("ethtool -S %s" % self.vm0_intf0, "#")
- rx_packets_after = re.findall("\s*rx.*\d+.*packets:\s*(\d*)", out)
+ rx_packets_after = re.findall(pattern, out)
nb_rx_pkts_after = 0
for i in range(len(rx_packets_after)):
nb_rx_pkts_after += int(rx_packets_after[i])
--
2.17.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-16 7:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-16 2:16 [dts] [PATCH V1] tests/vf kernel : change regex match zhao,meijuan
2018-11-16 7:49 ` Zhao, MeijuanX
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).