test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zhimin Huang <zhiminx.huang@intel.com>
To: dts@dpdk.org
Cc: Zhimin Huang <zhiminx.huang@intel.com>
Subject: [dts] [PATCH V1 4/4] tests/stats_checks:rich test point in case
Date: Wed,  8 Sep 2021 03:13:19 +0800	[thread overview]
Message-ID: <20210907191319.15494-5-zhiminx.huang@intel.com> (raw)
In-Reply-To: <20210907191319.15494-1-zhiminx.huang@intel.com>

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

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


      parent reply	other threads:[~2021-09-07 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 19:13 [dts] [PATCH V1 0/4] add plan and case Zhimin Huang
2021-09-07 19:13 ` [dts] [PATCH V1 1/4] test_plans/kernelpf_iavf_test_plan:rich test point in plan Zhimin Huang
2021-09-07 19:13 ` [dts] [PATCH V1 2/4] test_plans/stats_checks_test_plan:rich " Zhimin Huang
2021-09-07 19:13 ` [dts] [PATCH V1 3/4] tests/kernelpf_iavf:rich test point in case Zhimin Huang
2021-09-07 19:13 ` Zhimin Huang [this message]

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=20210907191319.15494-5-zhiminx.huang@intel.com \
    --to=zhiminx.huang@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).