From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 48E85271 for ; Thu, 24 Jan 2019 07:14:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2019 22:14:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,514,1539673200"; d="scan'208";a="132585678" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 23 Jan 2019 22:14:24 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 23 Jan 2019 22:14:24 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 23 Jan 2019 22:14:23 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.196]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.147]) with mapi id 14.03.0415.000; Thu, 24 Jan 2019 14:14:21 +0800 From: "Zhu, ShuaiX" To: "Zhu, WenhuiX" , "dts@dpdk.org" CC: "Zhu, WenhuiX" , "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V3] tests/dual_vlan check if the link is up Thread-Index: AQHUs5DLwCEDTabdrUu9hAwYDOBobaW98L4Q Date: Thu, 24 Jan 2019 06:14:21 +0000 Message-ID: <4DC48DF9BDA3E54A836D2D3C057DEC6F0B12C042@SHSMSX101.ccr.corp.intel.com> References: <1548298961-26285-1-git-send-email-wenhuix.zhu@intel.com> In-Reply-To: <1548298961-26285-1-git-send-email-wenhuix.zhu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 V3] tests/dual_vlan check if the 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: Thu, 24 Jan 2019 06:14:26 -0000 Tested-by: Zhu, ShuaiX > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui > Sent: Thursday, January 24, 2019 11:03 AM > To: dts@dpdk.org > Cc: Zhu, WenhuiX > Subject: [dts] [PATCH V3] tests/dual_vlan check if the link is up >=20 > The link maybe up failed after "start", make sure the link is really up, = and then > proceed to the next step. >=20 > Signed-off-by: zhuwenhui > --- > V2: add show_port() >=20 > V3: > 1. update show_port() to check_link_up() 2. in check_link_up(), add the s= olution > to show the port_id which is still down 3. use check_link_up() in test ca= ses >=20 > tests/TestSuite_dual_vlan.py | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py = index > 994ac42..d7fba3d 100644 > --- a/tests/TestSuite_dual_vlan.py > +++ b/tests/TestSuite_dual_vlan.py > @@ -40,6 +40,7 @@ Test the support of Dual VLAN Offload Features by Poll > Mode Drivers. > import utils > import random > import re > +import time >=20 > txvlan =3D 3 > outvlan =3D 1 > @@ -182,6 +183,17 @@ class TestDualVlan(TestCase): > else: > self.verify("%s %s" % (mode, modeName[mode]) in out, > "%s setting error" % mode) >=20 > + def verify_link_up(self): > + ports =3D self.dut.get_ports(self.nic) > + for port_id in range(len(ports)): > + out =3D self.dut.send_expect("show port info %s" % port_id, > "testpmd> ") > + port_time_up =3D 0 > + while (port_time_up <=3D 10) and ("Link status: down" in out= ): > + time.sleep(1) > + out =3D self.dut.send_expect("show port info %s" % port_= id, > "testpmd> ") > + port_time_up +=3D 1 > + self.verify("Link status: down" not in out, "Port %s > + Link down, please check your link" % port_id) > + > def multimode_test(self, caseIndex): > """ > Setup Strip/Filter/Extend/Insert enable/disable for synthetic te= st. > @@ -200,6 +212,7 @@ class TestDualVlan(TestCase): > self.dut.send_expect('tx_vlan set %s %s' % (dutTxPortId, > txvlan), "testpmd> ") > self.dut.send_expect('port start all', "testpmd> ") > self.dut.send_expect('start', "testpmd> ") > + self.verify_link_up() >=20 > configMode =3D "Strip %s, filter %s 0x1, extend %s, insert %s" % > (temp[0], temp[1], temp[2], "on" if (caseDef & txCase) !=3D 0 else "off") >=20 > @@ -218,6 +231,7 @@ class TestDualVlan(TestCase): > self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, > "testpmd> ") > self.dut.send_expect('port start all', "testpmd> ") > self.dut.send_expect('start', "testpmd> ") > + self.verify_link_up() >=20 > else: > self.dut.send_expect('rx_vlan add %s %s' % (invlan, > dutRxPortId), "testpmd> ") @@ -230,6 +244,7 @@ class > TestDualVlan(TestCase): > self.dut.send_expect('tx_vlan reset %s' % dutTxPortId, > "testpmd> ") > self.dut.send_expect('port start all', "testpmd> ") > self.dut.send_expect('start', "testpmd> ") > + self.verify_link_up() > self.dut.send_expect('rx_vlan rm %s %s' % (invlan, > dutRxPortId), "testpmd> ") > self.dut.send_expect('rx_vlan rm %s %s' % (outvlan, > dutRxPortId), "testpmd> ") >=20 > @@ -364,6 +379,7 @@ class TestDualVlan(TestCase): > self.dut.send_expect("tx_vlan set %s %s" % (dutTxPortId, txvlan)= , > "testpmd> ") > self.dut.send_expect("port start all", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") > + self.verify_link_up() >=20 > self.vlan_send_packet() > out =3D self.get_tcpdump_package() @@ -374,6 +390,7 @@ class > TestDualVlan(TestCase): > self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> > ") > self.dut.send_expect("port start all", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") > + self.verify_link_up() >=20 > self.vlan_send_packet() > out =3D self.get_tcpdump_package() > -- > 2.17.2