[dts] [PATCH V1] tests/dynamic_config and tx_preparation:ensure port is up before send pkt

Wenjie Li wenjiex.a.li at intel.com
Tue Oct 29 19:16:41 CET 2019


ensure port is up before send packets.

Signed-off-by: Wenjie Li <wenjiex.a.li at intel.com>
---
 tests/TestSuite_dynamic_config.py | 5 +++++
 tests/TestSuite_tx_preparation.py | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/tests/TestSuite_dynamic_config.py b/tests/TestSuite_dynamic_config.py
index 301f5b7..5e55b57 100644
--- a/tests/TestSuite_dynamic_config.py
+++ b/tests/TestSuite_dynamic_config.py
@@ -40,6 +40,8 @@ import utils
 import time
 
 from test_case import TestCase
+from pmd_output import PmdOutput
+
 
 #
 #
@@ -100,6 +102,9 @@ class TestDynamicConfig(TestCase):
         """
         Send 1 packet to portid
         """
+        self.pmd_output = PmdOutput(self.dut)
+        res = self.pmd_output.wait_link_status_up("all", 30)
+        self.verify(res is True, "there have port link is down")
 
         itf = self.tester.get_interface(self.tester.get_local_port(portid))
 
diff --git a/tests/TestSuite_tx_preparation.py b/tests/TestSuite_tx_preparation.py
index 366a547..215e961 100644
--- a/tests/TestSuite_tx_preparation.py
+++ b/tests/TestSuite_tx_preparation.py
@@ -116,6 +116,10 @@ class TestTX_preparation(TestCase):
         """
         Send packet to portid and output
         """
+        self.pmd_output = PmdOutput(self.dut)
+        res = self.pmd_output.wait_link_status_up("all", 30)
+        self.verify(res is True, "there have port link is down")
+
         LrgLength = random.randint(Normal_mtu, Max_mtu-100)
         pkts = {'IPv4/cksum TCP': 'Ether(dst="%s")/IP()/TCP(flags=0x10)\
                     /Raw(RandString(50))' % self.dmac,
-- 
2.17.1



More information about the dts mailing list