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 B725D58FE for ; Sat, 29 Dec 2018 09:50:48 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Dec 2018 00:50:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,413,1539673200"; d="scan'208";a="110774687" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 29 Dec 2018 00:50:47 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 29 Dec 2018 00:50:46 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 29 Dec 2018 00:50:46 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.196]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.65]) with mapi id 14.03.0415.000; Sat, 29 Dec 2018 16:50:44 +0800 From: "Zhu, ShuaiX" To: "Zhu, WenhuiX" , "dts@dpdk.org" CC: "Zhu, WenhuiX" , "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V2] tests/dual_vlan check if the port is up Thread-Index: AQHUn08HXCuuLycBuEebGvNH5jzRiaWVaEyQ Date: Sat, 29 Dec 2018 08:50:43 +0000 Message-ID: <4DC48DF9BDA3E54A836D2D3C057DEC6F0B125E67@SHSMSX101.ccr.corp.intel.com> References: <1546071645-14591-1-git-send-email-wenhuix.zhu@intel.com> In-Reply-To: <1546071645-14591-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 V2] tests/dual_vlan check if the port 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: Sat, 29 Dec 2018 08:50:49 -0000 Tested-by: Zhu, ShuaiX > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui > Sent: Saturday, December 29, 2018 4:21 PM > To: dts@dpdk.org > Cc: Zhu, WenhuiX > Subject: [dts] [PATCH V2] tests/dual_vlan check if the port is up >=20 > The port is down when the packet is sent. After "start", make sure the po= rt is > really open, and then proceed to the next step. >=20 > Signed-off-by: zhuwenhui > --- > tests/TestSuite_dual_vlan.py | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) >=20 > diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py = index > 994ac42..cbb87d4 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,16 @@ class TestDualVlan(TestCase): > else: > self.verify("%s %s" % (mode, modeName[mode]) in out, > "%s setting error" % mode) >=20 > + def show_port(self): > + out =3D self.dut.send_expect("show port info all", "testpmd> ") > + global port_time_up > + 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 all", "testpmd>= ") > + port_time_up +=3D 1 > + self.verify("Link status: down" not in out, "Port open failed") > + > def multimode_test(self, caseIndex): > """ > Setup Strip/Filter/Extend/Insert enable/disable for synthetic te= st. > @@ -200,6 +211,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.show_port() >=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 +230,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.show_port() >=20 > else: > self.dut.send_expect('rx_vlan add %s %s' % (invlan, > dutRxPortId), "testpmd> ") @@ -230,6 +243,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.show_port() > 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 +378,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.show_port() >=20 > self.vlan_send_packet() > out =3D self.get_tcpdump_package() @@ -374,6 +389,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.show_port() >=20 > self.vlan_send_packet() > out =3D self.get_tcpdump_package() > -- > 2.17.2