From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B141AA0679 for ; Mon, 29 Apr 2019 11:31:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 734DB5F14; Mon, 29 Apr 2019 11:31:50 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 23B704CA6 for ; Mon, 29 Apr 2019 11:31:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 02:31:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,409,1549958400"; d="scan'208";a="154668858" Received: from dpdk-test60.sh.intel.com ([10.67.111.110]) by orsmga002.jf.intel.com with ESMTP; 29 Apr 2019 02:31:46 -0700 From: Xueqin Lin To: dts@dpdk.org Cc: Xueqin Lin Date: Sun, 28 Apr 2019 23:31:36 -0400 Message-Id: <1556508696-79429-1-git-send-email-xueqin.lin@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dts] [PATCH] tests/vf_daemon: add show and clear statistics case X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: Xueqin Lin --- 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