[dts] [PATCH v3] framework: wait 10 seconds after testpmd starts to ensure link is up

Herbert Guan herbert.guan at arm.com
Mon Aug 7 13:38:36 CEST 2017


It'll take some time for links up after testpmd is started for
non-fiber test beds.
Before that "testpmd>" will be prompted but test shall not start
until links are up.  It's been tested that waiting 10 seconds can
resolve this issue on both fiber and non-fiber test beds.

Signed-off-by: Herbert Guan <herbert.guan at arm.com>
---
 framework/pmd_output.py             | 3 +++
 tests/TestSuite_dynamic_config.py   | 2 ++
 tests/TestSuite_queue_start_stop.py | 1 +
 3 files changed, 6 insertions(+)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index 260f42c..2d1e3d7 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -31,6 +31,7 @@
 
 import os
 import re
+from time import sleep
 from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
 from utils import create_mask
 
@@ -119,6 +120,8 @@ class PmdOutput():
             command += " --disable-hw-vlan-filter"
         out = self.dut.send_expect(command, "testpmd> ", 120)
         self.command = command
+        # wait 10s to ensure links getting up before test start.
+        sleep(10)
         return out
 
     def execute_cmd(self, pmd_cmd, expected='testpmd> ', timeout=TIMEOUT,
diff --git a/tests/TestSuite_dynamic_config.py b/tests/TestSuite_dynamic_config.py
index b4ddede..699c303 100644
--- a/tests/TestSuite_dynamic_config.py
+++ b/tests/TestSuite_dynamic_config.py
@@ -37,6 +37,7 @@ Test the dynamic driver configuration feature.
 """
 
 import utils
+import time
 
 from test_case import TestCase
 
@@ -122,6 +123,7 @@ class TestDynamicConfig(TestCase):
             cmd += " --disable-hw-vlan-filter"
 
         self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
+        time.sleep(5)
         self.dut.send_expect("start", "testpmd> ", 120)
 
 
diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
index d1df66b..cc031f5 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -131,6 +131,7 @@ class TestQueueStartStop(TestCase):
         #dpdk start
         try:
             self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
+            time.sleep(5)
             self.dut.send_expect("set fwd mac", "testpmd>")
             self.dut.send_expect("start", "testpmd>")
             self.check_forwarding([0, 0], self.nic)
-- 
1.8.3.1



More information about the dts mailing list