From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id CCA4F567E for ; Mon, 7 Aug 2017 04:42:39 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2017 19:42:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,335,1498546800"; d="scan'208";a="137001144" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 06 Aug 2017 19:42:38 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 6 Aug 2017 19:42:38 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 6 Aug 2017 19:42:38 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.197]) with mapi id 14.03.0319.002; Mon, 7 Aug 2017 10:42:03 +0800 From: "Liu, Yong" To: Herbert Guan , "dts@dpdk.org" , "jianbo.liu@linaro.org" Thread-Topic: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to ensure link is up Thread-Index: AQHTDPIwzVo7ZAG3PECLXYqFoIi84KJ4MVyQ Date: Mon, 7 Aug 2017 02:42:02 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E3B6E8@SHSMSX103.ccr.corp.intel.com> References: <1501831192-31150-1-git-send-email-herbert.guan@arm.com> In-Reply-To: <1501831192-31150-1-git-send-email-herbert.guan@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Mon, 07 Aug 2017 02:42:40 -0000 Hi Herbert, Not every kind of NIC will output link up message, e.g. FVL will not show "= Link Up" when LSC event coming.=20 Waiting for "LSC event" will be more suitable for the expecting prompt.=20 Agreed with change in pmd_ouput module, waiting 10 seconds will ensure the = stability of link status. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Herbert Guan > Sent: Friday, August 04, 2017 3:20 PM > To: dts@dpdk.org; jianbo.liu@linaro.org > Cc: Herbert Guan > Subject: [dts] [PATCH] framework: wait 10 seconds after testpmd starts to > ensure link is up >=20 > 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. >=20 > 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(-) >=20 > 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 @@ >=20 > import os > import re > +from time import sleep > from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver > from utils import create_mask >=20 > @@ -119,6 +120,8 @@ class PmdOutput(): > command +=3D " --disable-hw-vlan-filter" > out =3D self.dut.send_expect(command, "testpmd> ", 120) > self.command =3D command > + # wait 10s to ensure links getting up before test start. > + sleep(10) > return out >=20 > def execute_cmd(self, pmd_cmd, expected=3D'testpmd> ', timeout=3DTIM= EOUT, > 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 +=3D " --disable-hw-vlan-filter" >=20 > - self.dut.send_expect("%s" % cmd, "testpmd> ", 120) > + self.dut.send_expect("%s" % cmd, "Link Up", 120) > self.dut.send_expect("start", "testpmd> ", 120) >=20 >=20 > 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=3D0x1 --port-topology=3Dloop", "testpmd>", 120) > + self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- = - > i --portmask=3D0x1 --port-topology=3Dloop", "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