diff mbox series

[V1] tests/link_flowctrl: add the verification of Niantic card

Message ID 20200910074724.64291-1-yingyax.han@intel.com (mailing list archive)
State Accepted
Headers show
Series [V1] tests/link_flowctrl: add the verification of Niantic card | expand

Commit Message

hanyingya Sept. 10, 2020, 7:47 a.m. UTC
add the verification of Niantic card.
fix incorrect verification that only enabling rx link flow control.

Signed-off-by: hanyingya <yingyax.han@intel.com>
---
 tests/TestSuite_link_flowctrl.py | 44 ++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 14 deletions(-)

Comments

Tu, Lijuan Sept. 15, 2020, 8:34 a.m. UTC | #1
> Subject: [dts] [PATCH V1]tests/link_flowctrl: add the verification of Niantic card
> 
> add the verification of Niantic card.
> fix incorrect verification that only enabling rx link flow control.
> 
> Signed-off-by: hanyingya <yingyax.han@intel.com>

Applied
diff mbox series

Patch

diff --git a/tests/TestSuite_link_flowctrl.py b/tests/TestSuite_link_flowctrl.py
index 45b0654..9e608ba 100644
--- a/tests/TestSuite_link_flowctrl.py
+++ b/tests/TestSuite_link_flowctrl.py
@@ -455,9 +455,12 @@  class TestLinkFlowctrl(TestCase):
                                             pause_frame_fwd='off')
 
         self.logger.info("Packet loss: %.3f" % result)
-
-        self.verify(result <= 0.01,
-                    "Link flow control fail, the loss percent is more than 1%")
+        if self.nic == "niantic":
+            self.verify(result >= 0.3,
+                        "Link flow control fail, the loss percent is less than 30%")
+        else:
+            self.verify(result >= 0.5,
+                        "Link flow control fail, the loss percent is less than 50%")
 
     def test_perf_flowctrl_off_pause_fwd_on(self):
         """
@@ -469,9 +472,12 @@  class TestLinkFlowctrl(TestCase):
                                             pause_frame_fwd='on')
 
         self.logger.info("Packet loss: %.3f" % result)
-
-        self.verify(result >= 0.5,
-                    "Link flow control fail, the loss percent is less than 50%")
+        if self.nic == "niantic":
+            self.verify(result >= 0.3,
+                        "Link flow control fail, the loss percent is less than 30%")
+        else:
+            self.verify(result >= 0.5,
+                        "Link flow control fail, the loss percent is less than 50%")
 
     def test_perf_flowctrl_off_pause_fwd_off(self):
         """
@@ -483,9 +489,12 @@  class TestLinkFlowctrl(TestCase):
                                             pause_frame_fwd='off')
 
         self.logger.info("Packet loss: %.3f" % result)
-
-        self.verify(result >= 0.5,
-                    "Link flow control fail, the loss percent is less than 50%")
+        if self.nic == "niantic":
+            self.verify(result >= 0.3,
+                        "Link flow control fail, the loss percent is less than 30%")
+        else:
+            self.verify(result >= 0.5,
+                        "Link flow control fail, the loss percent is less than 50%")
 
     def test_perf_flowctrl_tx_on(self):
         """
@@ -533,9 +542,12 @@  class TestLinkFlowctrl(TestCase):
                            pause_frame_fwd='off')
         result = self.start_traffic(tgenInput)
         self.logger.info("Packet loss: %.3f" % result)
-        self.verify(result >= 0.5,
-                    "Link flow control fail after port stop/start, the loss percent is more than 50%")
-
+        if self.nic == "niantic":
+            self.verify(result >= 0.3,
+                        "Link flow control fail, the loss percent is less than 30%")
+        else:
+            self.verify(result >= 0.5,
+                        "Link flow control fail, the loss percent is less than 50%")
         # test again after port Stop/start
         self.dut.send_expect("stop", "testpmd> ")
         self.dut.send_expect("port stop 0", "testpmd> ")
@@ -543,8 +555,12 @@  class TestLinkFlowctrl(TestCase):
         self.dut.send_expect("start", "testpmd> ", 60)
         result = self.start_traffic(tgenInput)
         self.logger.info("Packet loss: %.3f" % result)
-        self.verify(result >= 0.5,
-                    "Link flow control fail after port stop/start, the loss percent is more than 50%")
+        if self.nic == "niantic":
+            self.verify(result >= 0.3,
+                        "Link flow control fail, the loss percent is less than 30%")
+        else:
+            self.verify(result >= 0.5,
+                        "Link flow control fail, the loss percent is less than 50%")
         self.dut.send_expect("stop", "testpmd> ")
 
     def tear_down_all(self):