test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests/vf_daemon: add show and clear statistics case
@ 2019-04-29  3:31 Xueqin Lin
       [not found] ` <4DC48DF9BDA3E54A836D2D3C057DEC6F0B178938@SHSMSX101.ccr.corp.intel.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xueqin Lin @ 2019-04-29  3:31 UTC (permalink / raw)
  To: dts; +Cc: Xueqin Lin

Signed-off-by: Xueqin Lin <xueqin.lin@intel.com>

---
 tests/TestSuite_vf_daemon.py | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/tests/TestSuite_vf_daemon.py b/tests/TestSuite_vf_daemon.py
index 0dd797b..41955c8 100644
--- a/tests/TestSuite_vf_daemon.py
+++ b/tests/TestSuite_vf_daemon.py
@@ -696,6 +696,40 @@ class TestVfDaemon(TestCase):
         self.vm0_testpmd.execute_cmd('vlan set strip off 0')
         self.vm0_testpmd.execute_cmd('vlan set filter off 0')
 
+    def test_stats_show_clear(self):
+        """
+        Show and clear statistics for a VF from PF
+        """
+        self.check_vf_link_status()
+        self.vf0_mac = self.vm0_testpmd.get_port_mac(0)
+        out = self.dut_testpmd.execute_cmd('show vf stats 0 0')
+        self.verify("RX-packets: 0" in out and "TX-packets: 0" in out,
+            "Fail to show VF RX and TX stats from PF")
+        out = self.vm0_testpmd.execute_cmd('show port stats 0')
+        self.verify("RX-packets: 0" in out and "TX-packets: 0" in out,
+            "Fail to show VF RX and TX stats")
+
+        self.vm0_testpmd.execute_cmd('set fwd mac')
+        self.vm0_testpmd.execute_cmd('set verbose 1')
+        self.vm0_testpmd.execute_cmd('start')
+
+        self.send_packet(self.vf0_mac, 0, 64 , 10)
+
+        out = self.dut_testpmd.execute_cmd('show vf stats 0 0')
+        self.verify("RX-packets: 10" in out and "TX-packets: 10" in out,
+            "Wrong to show VF RX and TX packets from PF")
+        out = self.vm0_testpmd.execute_cmd('show port stats 0')
+        self.verify("RX-packets: 10" in out and "TX-packets: 10" in out,
+            "Wrong to show VF RX and TX stats")
+
+        self.dut_testpmd.execute_cmd('clear vf stats 0 0')
+        out = self.dut_testpmd.execute_cmd('show vf stats 0 0')
+        self.verify("RX-packets: 0" in out and "TX-packets: 0" in out,
+            "Fail to clear VF RX and TX stats from PF")
+        out = self.vm0_testpmd.execute_cmd('show port stats 0')
+        self.verify("RX-packets: 0" in out and "TX-packets: 0" in out,
+            "Wrong to show VF RX and TX stats after clear")
+
 
     def tear_down(self):
         self.vm0_testpmd.quit()
-- 
2.5.5


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

end of thread, other threads:[~2019-05-13  2:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29  3:31 [dts] [PATCH] tests/vf_daemon: add show and clear statistics case Xueqin Lin
     [not found] ` <4DC48DF9BDA3E54A836D2D3C057DEC6F0B178938@SHSMSX101.ccr.corp.intel.com>
2019-04-30  1:46   ` Zhang, YanX A
2019-05-08  8:00 ` Li, WenjieX A
2019-05-13  2:03 ` Tu, Lijuan
2019-05-13  2:25   ` Lin, Xueqin

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