test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xueqin Lin <xueqin.lin@intel.com>
To: dts@dpdk.org
Cc: Xueqin Lin <xueqin.lin@intel.com>
Subject: [dts] [PATCH] tests/vf_daemon: add show and clear statistics case
Date: Sun, 28 Apr 2019 23:31:36 -0400	[thread overview]
Message-ID: <1556508696-79429-1-git-send-email-xueqin.lin@intel.com> (raw)

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


             reply	other threads:[~2019-04-29  9:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  3:31 Xueqin Lin [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1556508696-79429-1-git-send-email-xueqin.lin@intel.com \
    --to=xueqin.lin@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).