test suite reviews and discussions
 help / color / mirror / Atom feed
From: Hongbo Li <hongbox.li@intel.com>
To: dts@dpdk.org
Cc: zhiminx.huang@intel.com, Hongbo Li <hongbox.li@intel.com>
Subject: [PATCH V1] tests/TestSuite_macsec_for_ixgbe:adapt to different CPUs
Date: Fri, 12 Aug 2022 15:51:52 +0000	[thread overview]
Message-ID: <20220812155152.17733-1-hongbox.li@intel.com> (raw)

According to the explanation of the DPDK developer, setting the same PN value on different CPUs will have different behaviors.
This patch is used to help case adapt different CPUs.

Signed-off-by: Hongbo Li <hongbox.li@intel.com>
---
 test_plans/macsec_for_ixgbe_test_plan.rst |  8 ++++--
 tests/TestSuite_macsec_for_ixgbe.py       | 32 ++++++++++++++++-------
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/test_plans/macsec_for_ixgbe_test_plan.rst b/test_plans/macsec_for_ixgbe_test_plan.rst
index 22218bb8..b2c8ecda 100644
--- a/test_plans/macsec_for_ixgbe_test_plan.rst
+++ b/test_plans/macsec_for_ixgbe_test_plan.rst
@@ -223,10 +223,14 @@ Test Case 3: MACsec send and receive with different parameters
    It can't be set successfully.
 
 3. Set "pn" to 0xffffffec on both rx and tx sides.
-   Rx port can receive four packets.
+   Rx port can receive four packets.But the expected number
+   of packets is 3/4/5 While the explanation that DPDK developers
+   gave is that it's hardware's behavior.
 
    Set "pn" to 0xffffffed on both rx and tx sides.
-   Rx port can receive three packets.
+   Rx port can receive three packets.But the expected number
+   of packets is 3/4. While the explanation that DPDK developers
+   gave is that it's hardware's behavior.
 
    Set "pn" to 0xffffffee/0xffffffef on both rx and tx sides.
    Rx port can receive three packets too. But the expected number
diff --git a/tests/TestSuite_macsec_for_ixgbe.py b/tests/TestSuite_macsec_for_ixgbe.py
index 643b3dee..ade31e0b 100644
--- a/tests/TestSuite_macsec_for_ixgbe.py
+++ b/tests/TestSuite_macsec_for_ixgbe.py
@@ -236,6 +236,26 @@ class TestMacsecForIxgbe(TestCase):
             "MACsec pkts receive failed",
         )
 
+    def check_pn_boundary_value(self, i, pkt_num):
+        if i == "0xffffffec":
+            try:
+                self.verify(int(pkt_num) == 4, "Rx port can't receive 4 pkts")
+            except:
+                self.verify(
+                    int(pkt_num) in [3, 4, 5], "Rx port can't receive the expected pkts"
+                )
+                msg = (
+                    str(pkt_num)
+                    + " packages received, the hardware behavior is different on each series of CPUs"
+                )
+                self.logger.warning(msg)
+            finally:
+                self.clear_port_xstats()
+        else:
+            self.verify(
+                int(pkt_num) in [1, 2, 3, 4], "Rx port can't receive the expected pkts"
+            )
+
     def test_MACsec_pkts_tx_and_rx(self):
         """
         MACsec packets send and receive
@@ -364,15 +384,9 @@ class TestMacsecForIxgbe(TestCase):
                     0, 0, 0, i, "00112200000000000000000000000000"
                 )
                 pkt_num = self.packets_receive_num()
-                if i == "0xffffffec":
-                    self.verify(int(pkt_num[0]) == 4, "Rx port can't receive four pkts")
-                    self.clear_port_xstats()
-                else:
-                    self.verify(
-                        int(pkt_num[0]) == 3, "Rx port can't receive three pkts"
-                    )
-                    self.session_sec.send_expect("quit", "#")
-                    self.dut.send_expect("quit", "#")
+                self.check_pn_boundary_value(i, int(pkt_num[0]))
+                self.session_sec.send_expect("quit", "#")
+                self.dut.send_expect("quit", "#")
 
         # subcase4:set various key on rx and tx port
         for i in [
-- 
2.17.1


             reply	other threads:[~2022-08-12  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 15:51 Hongbo Li [this message]
2022-09-08  4:50 ` lijuan.tu

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=20220812155152.17733-1-hongbox.li@intel.com \
    --to=hongbox.li@intel.com \
    --cc=dts@dpdk.org \
    --cc=zhiminx.huang@intel.com \
    /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).