From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7233AA0C41; Tue, 7 Sep 2021 12:42:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DCF841171; Tue, 7 Sep 2021 12:42:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id B2E88410EF for ; Tue, 7 Sep 2021 12:42:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10099"; a="283873637" X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="283873637" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:57 -0700 X-IronPort-AV: E=Sophos;i="5.85,274,1624345200"; d="scan'208";a="469145932" Received: from unknown (HELO localhost.localdomain) ([10.240.183.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 03:41:56 -0700 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Date: Wed, 8 Sep 2021 03:13:19 +0800 Message-Id: <20210907191319.15494-5-zhiminx.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907191319.15494-1-zhiminx.huang@intel.com> References: <20210907191319.15494-1-zhiminx.huang@intel.com> Subject: [dts] [PATCH V1 4/4] tests/stats_checks:rich test point in case X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" add some new test points in test case: add clear stats test. Signed-off-by: Zhimin Huang --- tests/TestSuite_stats_checks.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_stats_checks.py b/tests/TestSuite_stats_checks.py index 5dc21b6..58c5236 100644 --- a/tests/TestSuite_stats_checks.py +++ b/tests/TestSuite_stats_checks.py @@ -208,10 +208,22 @@ class TestStatsChecks(TestCase): self.exec("clear port xstats all") org_xstats = self.get_xstats([rx_port, tx_port]) self.verify_results(org_xstats, rx_port, tx_port, if_zero=True) - self.exec("start") + final_xstats, stats_data = self.sendpkt_get_xstats(rx_port, tx_port, if_vf) + self.verify_results(final_xstats, rx_port, tx_port, stats_data=stats_data) + self.exec("clear port stats all") + clear_stats = self.get_xstats([rx_port, tx_port]) + self.verify_results(clear_stats, rx_port, tx_port, if_zero=True) - self.send_pkt_with_random_ip(tx_port, count=100, if_vf=if_vf) + final_xstats, stats_data = self.sendpkt_get_xstats(rx_port, tx_port, if_vf) + self.verify_results(final_xstats, rx_port, tx_port, stats_data=stats_data) + self.exec("clear port xstats all") + clear_xstats = self.get_xstats([rx_port, tx_port]) + self.verify_results(clear_xstats, rx_port, tx_port, if_zero=True) + self.pmdout.quit() + def sendpkt_get_xstats(self, rx_port, tx_port, if_vf): + self.exec("start") + self.send_pkt_with_random_ip(tx_port, count=100, if_vf=if_vf) self.exec("stop") if rx_port == tx_port: final_xstats = self.get_xstats([rx_port]) @@ -226,8 +238,7 @@ class TestStatsChecks(TestCase): rx_port: rx_stats_info, tx_port: tx_stats_info } - self.verify_results(final_xstats, rx_port, tx_port, stats_data=stats_data) - self.pmdout.quit() + return final_xstats, stats_data def set_up_all(self): """ -- 2.17.1