From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 41CDB2C19 for ; Fri, 4 Aug 2017 09:20:09 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B2BAF1596; Fri, 4 Aug 2017 00:20:08 -0700 (PDT) Received: from localhost.localdomain.com (unknown [10.169.40.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2267B3F3E1; Fri, 4 Aug 2017 00:20:08 -0700 (PDT) From: Herbert Guan To: dts@dpdk.org, jianbo.liu@linaro.org Cc: Herbert Guan Date: Fri, 4 Aug 2017 15:19:52 +0800 Message-Id: <1501831192-31150-1-git-send-email-herbert.guan@arm.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 07:20:09 -0000 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. "Link Up" 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 --- 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..e344aac 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, "Link Up", 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..9e190f6 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", "Link Up", 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