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 32891A04A3; Mon, 4 Nov 2019 03:39:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26AAF378E; Mon, 4 Nov 2019 03:39:27 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0CCA2374E for ; Mon, 4 Nov 2019 03:39:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Nov 2019 18:39:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,265,1569308400"; d="scan'208";a="212217807" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 03 Nov 2019 18:39:24 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 3 Nov 2019 18:39:24 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 3 Nov 2019 18:39:24 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.225]) with mapi id 14.03.0439.000; Mon, 4 Nov 2019 10:39:22 +0800 From: "Tu, Lijuan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts] [PATCH V1] tests/shutdown_api: optimize script Thread-Index: AQHVh+8STIi6GfL7Z0mt0J0MFYKKOKd6Yjrw Date: Mon, 4 Nov 2019 02:39:22 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB5D245@SHSMSX101.ccr.corp.intel.com> References: <1571680746-51972-1-git-send-email-wenjiex.a.li@intel.com> In-Reply-To: <1571680746-51972-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTNmODdjOTUtMWU1My00NzEyLTlmMWQtMjdlZTAzYWY1NjdiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRWVubVF0N25LSzh1ZE9BRGVla0J2dkV0bGpyQ05naHFHWm9IQmZoNzJ2WEVJcDVJSEdYS0xLdFJHYU1rOWl2QyJ9 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/shutdown_api: optimize script 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, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li > Sent: Tuesday, October 22, 2019 1:59 AM > To: dts@dpdk.org > Cc: Li, WenjieX A > Subject: [dts] [PATCH V1] tests/shutdown_api: optimize script >=20 > 1. disable promisc packets > 2. check the ports are UP before sending packets >=20 > Signed-off-by: Wenjie Li > --- > tests/TestSuite_shutdown_api.py | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/tests/TestSuite_shutdown_api.py > b/tests/TestSuite_shutdown_api.py index 32bb765..7d5afa7 100644 > --- a/tests/TestSuite_shutdown_api.py > +++ b/tests/TestSuite_shutdown_api.py > @@ -94,6 +94,10 @@ class TestShutdownApi(TestCase): > """ > Send packages according to parameters. > """ > + # check the ports are UP before sending packets > + res =3D self.pmdout.wait_link_status_up('all') > + self.verify(res is True, 'there have port link is down') > + > port0_stats =3D self.get_stats(txPort) > gp0tx_pkts, gp0tx_bytes =3D [port0_stats['TX-packets'], port0_st= ats['TX- > bytes']] > port1_stats =3D self.get_stats(rxPort) @@ -188,6 +192,7 @@ class > TestShutdownApi(TestCase): > Stop and Restar. > """ > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > self.dut.send_expect("set fwd mac", "testpmd>") > self.dut.send_expect("start", "testpmd> ") @@ -244,6 +249,7 @@ c= lass > TestShutdownApi(TestCase): > testcorelist =3D self.dut.get_core_list("1S/8C/1T", socket=3Dsel= f.ports_socket) >=20 > self.pmdout.start_testpmd(testcorelist, "--portmask=3D%s --port= - > topology=3Dloop" % utils.create_mask([self.ports[0]]), socket=3Dself.port= s_socket) > + self.dut.send_expect("set promisc all off", "testpmd>") > fwdcoremask =3D utils.create_mask(testcorelist[-3:]) >=20 > self.dut.send_expect("port stop all", "testpmd> ", 100) @@ -269,= 6 > +275,7 @@ class TestShutdownApi(TestCase): > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port= - > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > else: > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port= - > topology=3Dloop --disable-crc-strip" % utils.create_mask(self.ports), > socket=3Dself.ports_socket) > + self.dut.send_expect("set promisc all off", "testpmd>") > out =3D self.dut.send_expect("show config rxtx", "testpmd> ") > Rx_offloads =3D re.compile('Rx offloads=3D(.*?)\s+?').findall(ou= t, re.S) > crc_keep_temp =3D [] > @@ -306,6 +313,7 @@ class TestShutdownApi(TestCase): > return >=20 > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > out =3D self.tester.send_expect( > "ethtool %s" % > self.tester.get_interface(self.tester.get_local_port(self.ports[0])), "# = ") @@ - > 356,6 +364,7 @@ class TestShutdownApi(TestCase): >=20 > jumbo_size =3D 2048 > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config all max-pkt-len %d" % jumbo_si= ze, > "testpmd> ") > out =3D self.dut.send_expect("vlan set strip off all", "testpmd>= ") @@ - > 402,6 +411,7 @@ class TestShutdownApi(TestCase): > Enable/Disable RSS. > """ > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config rss ip", "testpmd> ") @@ -415,= 6 > +425,7 @@ class TestShutdownApi(TestCase): > Change numbers of rxd and txd. > """ > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config all rxd 1024", "testpmd> ") @@= -434,6 > +445,7 @@ class TestShutdownApi(TestCase): > Change the Number of rxd/txd. > """ > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config all rxd 1024", "testpmd> ") @@= -464,6 > +476,7 @@ class TestShutdownApi(TestCase): > Change RX/TX thresholds > """ > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("port config all txfreet 32", "testpmd> ") = @@ - > 500,6 +513,7 @@ class TestShutdownApi(TestCase): > stress_iterations =3D 10 >=20 > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") >=20 > tgenInput =3D [] > for port in self.ports: > @@ -525,6 +539,7 @@ class TestShutdownApi(TestCase): > return >=20 > self.pmdout.start_testpmd("Default", "--portmask=3D%s --port- > topology=3Dloop" % utils.create_mask(self.ports), socket=3Dself.ports_soc= ket) > + self.dut.send_expect("set promisc all off", "testpmd>") > self.dut.send_expect("set fwd mac", "testpmd>") > self.dut.send_expect("start", "testpmd>") >=20 > -- > 2.17.1