test suite reviews and discussions
 help / color / mirror / Atom feed
From: Herbert Guan <herbert.guan@arm.com>
To: dts@dpdk.org, yong.liu@intel.com
Cc: jianbo.liu@linaro.org, Herbert Guan <herbert.guan@arm.com>
Subject: [dts] [PATCH v2] framework: wait 10 seconds after testpmd starts to ensure link is up
Date: Mon,  7 Aug 2017 11:16:56 +0800	[thread overview]
Message-ID: <1502075816-1328-1-git-send-email-herbert.guan@arm.com> (raw)
In-Reply-To: <1501831192-31150-1-git-send-email-herbert.guan@arm.com>

It'll take some time for links up after testpmd is started.
Before that "testpmd>" will be prompted but test shall not start
until links are up.  "LSC event" is a better checker for a specific
test case.  While since pmd_output.py is usd by many test cases, wait
10 seconds will be safer, in case of some test cases do not actually
expect for an established link.

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

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..4da493e 100644
--- a/tests/TestSuite_dynamic_config.py
+++ b/tests/TestSuite_dynamic_config.py
@@ -121,7 +121,7 @@ class TestDynamicConfig(TestCase):
 	if "cavium" in self.dut.nic_type:
             cmd += " --disable-hw-vlan-filter"
 
-        self.dut.send_expect("%s" % cmd, "testpmd> ", 120)
+        self.dut.send_expect("%s" % cmd, "LSC event", 120)
         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..dea81c9 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -130,7 +130,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)
+            self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "LSC event", 120)
             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

  parent reply	other threads:[~2017-08-07  3:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04  7:19 [dts] [PATCH] " Herbert Guan
2017-08-07  2:42 ` Liu, Yong
2017-08-07  3:25   ` Herbert Guan
2017-08-07  3:16 ` Herbert Guan [this message]
2017-08-07 11:38   ` [dts] [PATCH v3] " Herbert Guan
2017-08-09 18:03     ` Liu, Yong

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=1502075816-1328-1-git-send-email-herbert.guan@arm.com \
    --to=herbert.guan@arm.com \
    --cc=dts@dpdk.org \
    --cc=jianbo.liu@linaro.org \
    --cc=yong.liu@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).