test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH V1] tests/TestSuite_macsec_for_ixgbe:adapt to different CPUs
@ 2022-08-12 15:51 Hongbo Li
  2022-09-08  4:50 ` lijuan.tu
  0 siblings, 1 reply; 2+ messages in thread
From: Hongbo Li @ 2022-08-12 15:51 UTC (permalink / raw)
  To: dts; +Cc: zhiminx.huang, Hongbo Li

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH V1] tests/TestSuite_macsec_for_ixgbe:adapt to different CPUs
  2022-08-12 15:51 [PATCH V1] tests/TestSuite_macsec_for_ixgbe:adapt to different CPUs Hongbo Li
@ 2022-09-08  4:50 ` lijuan.tu
  0 siblings, 0 replies; 2+ messages in thread
From: lijuan.tu @ 2022-09-08  4:50 UTC (permalink / raw)
  To: dts, Hongbo Li; +Cc: zhiminx.huang, Hongbo Li

On Fri, 12 Aug 2022 15:51:52 +0000, Hongbo Li <hongbox.li@intel.com> wrote:
> 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>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-08  4:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 15:51 [PATCH V1] tests/TestSuite_macsec_for_ixgbe:adapt to different CPUs Hongbo Li
2022-09-08  4:50 ` lijuan.tu

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