From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0036A04C1; Fri, 22 Nov 2019 07:21:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 76FB32C28; Fri, 22 Nov 2019 07:21:25 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 894C12BF9 for ; Fri, 22 Nov 2019 07:21:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 22:21:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,228,1571727600"; d="scan'208";a="408800080" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 21 Nov 2019 22:21:22 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:21:22 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:21:21 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0439.000; Fri, 22 Nov 2019 14:21:19 +0800 From: "Tu, Lijuan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts] [PATCH V1] tests: optimize three suites Thread-Index: AQHVmGpoZSV902zlGkqxvPMov/594aeWyTLA Date: Fri, 22 Nov 2019 06:21:19 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB678AA@SHSMSX101.ccr.corp.intel.com> References: <1573492735-54128-1-git-send-email-wenjiex.a.li@intel.com> In-Reply-To: <1573492735-54128-1-git-send-email-wenjiex.a.li@intel.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: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGRjNDAwNmQtNDBiMC00NzdjLTg1NTYtZTA3ODU5ZDVmN2JmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVGJodE1TRFloODk5T3JnU1wvXC8xVXRCcHk0OXpuWXdTWmpYaHpwODZONmxkMHhXbExGNUZ0N0NuNGZGbE5aTnZ4In0= 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 V1] tests: optimize three suites 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied failed, please rework, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li > Sent: Tuesday, November 12, 2019 1:19 AM > To: dts@dpdk.org > Cc: Li, WenjieX A > Subject: [dts] [PATCH V1] tests: optimize three suites >=20 > ensure the DUT port is up before the tester send packets in below suites: > tests/TestSuite_metering_and_policing.py > tests/TestSuite_short_live.py > tests/TestSuite_tx_preparation.py >=20 > Signed-off-by: Wenjie Li > --- > tests/TestSuite_metering_and_policing.py | 8 ++++++-- > tests/TestSuite_short_live.py | 12 ++++++++++++ > tests/TestSuite_tx_preparation.py | 5 +++++ > 3 files changed, 23 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/TestSuite_metering_and_policing.py > b/tests/TestSuite_metering_and_policing.py > index 77da805..ef8c419 100644 > --- a/tests/TestSuite_metering_and_policing.py > +++ b/tests/TestSuite_metering_and_policing.py > @@ -42,7 +42,7 @@ from test_case import TestCase from plotting import > Plotting from settings import HEADER_SIZE from dut import Dut > - > +from pmd_output import PmdOutput >=20 > class TestMeteringAndPolicing(TestCase): > scapyCmds =3D [] > @@ -244,7 +244,11 @@ class TestMeteringAndPolicing(TestCase): > """ > Send packet and check the stats. If expect_port =3D=3D -1, the p= acket should > be dropped. > """ > - time.sleep(3) > + # check the ports are UP before sending packets > + self.pmd_out =3D PmdOutput(self.dut) > + res =3D self.pmd_out.wait_link_status_up('all', 15) > + self.verify(res is True, 'there have port link is down') > + > rx_before =3D [] > tx_before =3D [] > for i in range(0, len(self.dut_ports)): > diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.p= y > index 4e1ee15..dfccbd8 100644 > --- a/tests/TestSuite_short_live.py > +++ b/tests/TestSuite_short_live.py > @@ -141,6 +141,12 @@ class TestShortLiveApp(TestCase): > self.dut.send_expect("set fwd mac", "testpmd>") > self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("start", "testpmd>") > + > + # check the ports are UP before sending packets > + self.pmd_out =3D PmdOutput(self.dut) > + res =3D self.pmd_out.wait_link_status_up('all', 15) > + self.verify(res is True, 'there have port link is down') > + > self.check_forwarding([0, 1], self.nic) >=20 > def test_start_up_time(self): > @@ -166,6 +172,12 @@ class TestShortLiveApp(TestCase): > self.dut.send_expect("set fwd mac", "testpmd>") > self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("start", "testpmd>") > + > + # check the ports are UP before sending packets > + self.pmd_out =3D PmdOutput(self.dut) > + res =3D self.pmd_out.wait_link_status_up('all', 15) > + self.verify(res is True, 'there have port link is down') > + > self.check_forwarding([0, 1], self.nic) >=20 > # kill with different Signal diff --git > a/tests/TestSuite_tx_preparation.py b/tests/TestSuite_tx_preparation.py > index 366a547..90ab7b6 100644 > --- a/tests/TestSuite_tx_preparation.py > +++ b/tests/TestSuite_tx_preparation.py > @@ -116,6 +116,11 @@ class TestTX_preparation(TestCase): > """ > Send packet to portid and output > """ > + # check the ports are UP before sending packets > + self.pmd_out =3D PmdOutput(self.dut) > + res =3D self.pmd_out.wait_link_status_up('all', 15) > + self.verify(res is True, 'there have port link is down') > + > LrgLength =3D random.randint(Normal_mtu, Max_mtu-100) > pkts =3D {'IPv4/cksum TCP': 'Ether(dst=3D"%s")/IP()/TCP(flags=3D= 0x10)\ > /Raw(RandString(50))' % self.dmac, > -- > 2.17.1