test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jiale Song <songx.jiale@intel.com>
To: dts@dpdk.org
Cc: Jiale Song <songx.jiale@intel.com>
Subject: [dts] [PATCH V3 2/2] tests/stats_checks: add a case
Date: Tue, 18 Apr 2023 14:00:10 +0000	[thread overview]
Message-ID: <20230418140010.168944-3-songx.jiale@intel.com> (raw)
In-Reply-To: <20230418140010.168944-1-songx.jiale@intel.com>

add a case to test pf negative xstats check.

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_stats_checks.py | 47 +++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/TestSuite_stats_checks.py b/tests/TestSuite_stats_checks.py
index 6ab5dd19..a9c6e040 100644
--- a/tests/TestSuite_stats_checks.py
+++ b/tests/TestSuite_stats_checks.py
@@ -28,6 +28,8 @@ prefix_list = [
     "tx_good_packets",
     "rx_good_bytes",
     "tx_good_bytes",
+    "rx_errors",
+    "rx_unicast_packets",
     "tx_size_64_packets",
     "tx_size_65_to_127_packets",
     "tx_size_128_to_255_packets",
@@ -42,6 +44,7 @@ prefix_list = [
     "rx_size_512_to_1023_packets",
     "rx_size_1024_to_1522_packets",
     "rx_size_1523_to_max_packets",
+    "rx_oversize_errors",
     "rx_size_1024_to_max_packets",  # ixgbe
     "tx_size_1024_to_max_packets",  # ixgbe
 ]
@@ -384,6 +387,7 @@ class TestStatsChecks(TestCase):
         """
         self.netobj_0.enable_jumbo(framesize=1518)
         self.netobj_1.enable_jumbo(framesize=1518)
+        self.pmdout.quit()
         self.dut.kill_all()
         if self._suite_result.test_case == "test_xstats_check_vf":
             self.dut.destroy_sriov_vfs_by_port(self.dut_ports[0])
@@ -442,3 +446,46 @@ class TestStatsChecks(TestCase):
                 dcf_flag=self.dcf_mode, param="--txq=4 --rxq=4 --max-pkt-len=9000"
             )
         self.xstats_check(0, 0, if_vf=True)
+
+    def test_negative_xstats_check_pf(self):
+        """
+        Test Case: PF negative xstats check
+        """
+        self.pmdout.start_testpmd("default")
+        self.pmdout.execute_cmd("set fwd mac")
+        self.pmdout.execute_cmd("start")
+        self.netobj_0.enable_jumbo(framesize=5018)
+        self.pmdout.wait_link_status_up("all")
+        self.pmdout.execute_cmd("clear port xstats all")
+        self.pmdout.execute_cmd("show port xstats all")
+        # send jumbo frames
+        self.send_scapy_packet(
+            self.rx_port,
+            f'Ether(dst=dutmac, src="52:00:00:00:00:00")/IP()/Raw(load="X"*4980)',
+        )
+        # get all port xstats
+        all_xstats = self.get_xstats([self.rx_port, self.tx_port])
+        rx_xstats = all_xstats[self.rx_port]
+        # check rx port can not receive packet and rx_errors increased
+        for key, value in rx_xstats.items():
+            if key in ["rx_errors", "rx_oversize_errors"]:
+                self.verify(
+                    value == 1,
+                    "the expected value of %s is 1, but the actual value is %s!!!"
+                    % (key, value),
+                )
+            else:
+                self.verify(
+                    value == 0,
+                    "the expected value of %s is 0, but the actual value is %s!!!"
+                    % (key, value),
+                )
+        # check all statistics are 0 for tx port.
+        tx_xstats = all_xstats[self.tx_port]
+        for key, value in tx_xstats.items():
+            self.verify(
+                value == 0,
+                "the expected value of %s is 0, but the actual value is %s!!!"
+                % (key, value),
+            )
+        self.pmdout.execute_cmd("stop")
-- 
2.25.1


  parent reply	other threads:[~2023-04-18  5:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 14:00 [dts] [PATCH V3 0/2] add a case to test pf negative xstats check Jiale Song
2023-04-18 14:00 ` [dts] [PATCH V3 1/2] test_plans/stats_checks: add a case Jiale Song
2023-04-18 14:00 ` Jiale Song [this message]
2023-04-18  8:48   ` [dts] [PATCH V3 2/2] tests/stats_checks: " Peng, Yuan
2023-04-26  2:50   ` lijuan.tu
  -- strict thread matches above, loose matches on Subject: below --
2023-04-18 11:48 [dts] [PATCH V3 0/2] add a case to test pf negative xstats check Jiale Song
2023-04-18 11:48 ` [dts] [PATCH V3 2/2] tests/stats_checks: add a case Jiale Song

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=20230418140010.168944-3-songx.jiale@intel.com \
    --to=songx.jiale@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).