diff mbox series

[V2,4/4] tests/stats_checks:add new test case

Message ID 20210907193714.16028-5-zhiminx.huang@intel.com (mailing list archive)
State Accepted
Headers show
Series add plan and case | expand

Checks

Context Check Description
ci/Intel-dts-test fail Testing issues

Commit Message

Huang, ZhiminX Sept. 7, 2021, 7:37 p.m. UTC
add some new test points in test case:
 add clear stats test.

Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>
---
 tests/TestSuite_stats_checks.py | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

Comments

Huang, ZhiminX Sept. 7, 2021, 11:17 a.m. UTC | #1
> -----Original Message-----
> From: Huang, ZhiminX <zhiminx.huang@intel.com>
> Sent: Wednesday, September 8, 2021 3:37 AM
> To: dts@dpdk.org
> Cc: Huang, ZhiminX <zhiminx.huang@intel.com>
> Subject: [dts] [PATCH V2 4/4] tests/stats_checks:add new test case
> 
Tested-by: Zhimin Huang <zhiminx.huang@intel.com >
Tu, Lijuan Sept. 14, 2021, 8:40 a.m. UTC | #2
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Huang, ZhiminX
> Sent: 2021年9月7日 19:17
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V2 4/4] tests/stats_checks:add new test case
> 
> > -----Original Message-----
> > From: Huang, ZhiminX <zhiminx.huang@intel.com>
> > Sent: Wednesday, September 8, 2021 3:37 AM
> > To: dts@dpdk.org
> > Cc: Huang, ZhiminX <zhiminx.huang@intel.com>
> > Subject: [dts] [PATCH V2 4/4] tests/stats_checks:add new test case
> >
> Tested-by: Zhimin Huang <zhiminx.huang@intel.com >

Applied, thanks
>
diff mbox series

Patch

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):
         """