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 3E949A00BE; Mon, 27 Apr 2020 09:51:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 353891C132; Mon, 27 Apr 2020 09:51:31 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1DD261BF8E for ; Mon, 27 Apr 2020 09:51:29 +0200 (CEST) IronPort-SDR: 7eNX0o0OVx6XlinqSu45SxKIHSoazcM+GGHoEf9P1tXrKKxNh2eWJJzb4NEvLeEAOtWCigEN1T 8WMB9kgrWNBA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 00:51:29 -0700 IronPort-SDR: lmHMgcoSKKSIXy08BfRFO5z0JLS3/GLA1/bjTrUv3ukwIfitq0e0RSq1U818uBJjmUvbsVGd6b kyzcWm9vyCtA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,323,1583222400"; d="scan'208";a="292374845" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 27 Apr 2020 00:51:29 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 Apr 2020 00:51:28 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 Apr 2020 00:51:28 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Mon, 27 Apr 2020 15:51:26 +0800 From: "Tu, Lijuan" To: "Lin, Xueqin" , "dts@dpdk.org" CC: "Lin, Xueqin" Thread-Topic: [dts] [PATCH] tests/shutdown_api: add allmulticast and more check for link, promisc cases Thread-Index: AQHWG7BsnH1v5ftHAEGJ1RpO/PAW+KiMmenQ Date: Mon, 27 Apr 2020 07:51:25 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC12AD4@SHSMSX101.ccr.corp.intel.com> References: <1587873204-163786-1-git-send-email-xueqin.lin@intel.com> In-Reply-To: <1587873204-163786-1-git-send-email-xueqin.lin@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-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] tests/shutdown_api: add allmulticast and more check for link, promisc cases 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 Xueqin Lin > Sent: Sunday, April 26, 2020 11:53 AM > To: dts@dpdk.org > Cc: Lin, Xueqin > Subject: [dts] [PATCH] tests/shutdown_api: add allmulticast and more chec= k > for link, promisc cases >=20 > Signed-off-by: Xueqin Lin >=20 > --- > tests/TestSuite_shutdown_api.py | 43 > +++++++++++++++++++++++++++++++++++++---- > 1 file changed, 39 insertions(+), 4 deletions(-) >=20 > diff --git a/tests/TestSuite_shutdown_api.py > b/tests/TestSuite_shutdown_api.py index b5c0d5a..181a385 100644 > --- a/tests/TestSuite_shutdown_api.py > +++ b/tests/TestSuite_shutdown_api.py > @@ -89,14 +89,14 @@ class TestShutdownApi(TestCase): > stats =3D output.get_pmd_stats(portid) > return stats >=20 > - def check_forwarding(self, ports=3DNone, pktSize=3D68, received=3DTr= ue, > vlan=3DFalse, promisc=3DFalse, vlan_strip=3DFalse): > + def check_forwarding(self, ports=3DNone, pktSize=3D68, received=3DTr= ue, > vlan=3DFalse, promisc=3DFalse, allmulti=3DFalse, vlan_strip=3DFalse): > if ports is None: > ports =3D self.ports > if len(ports) =3D=3D 1: > - self.send_packet(ports[0], ports[0], pktSize, received, vlan= , promisc, > vlan_strip) > + self.send_packet(ports[0], ports[0], pktSize, received, > + vlan, promisc, allmulti, vlan_strip) > return >=20 > - def send_packet(self, txPort, rxPort, pktSize=3D68, received=3DTrue,= vlan=3DFalse, > promisc=3DFalse, vlan_strip=3DFalse): > + def send_packet(self, txPort, rxPort, pktSize=3D68, received=3DTrue, > vlan=3DFalse, promisc=3DFalse, allmulti=3DFalse, vlan_strip=3DFalse): > """ > Send packages according to parameters. > """ > @@ -117,7 +117,8 @@ class TestShutdownApi(TestCase): > # when promisc is true, destination mac should be fake > if promisc: > dmac =3D "00:00:00:00:00:01" > - > + if allmulti: > + dmac =3D "01:00:00:33:00:01" > if vlan: > padding =3D pktSize - HEADER_SIZE['eth'] - HEADER_SIZE['ip']= -4 > pkg =3D 'Ether(src=3D"%s", dst=3D"%s")/Dot1Q(vlan=3D1)/IP()/= Raw(load=3D"P" > * %d)' % (smac, dmac, padding) @@ -366,17 +367,44 @@ class > TestShutdownApi(TestCase): > print((" !!! DEBUG IT: " + e.message)) > self.verify(False, e.message) >=20 > + self.check_forwarding(ports, received=3DFalse, promisc=3DTrue) > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("set promisc all on", "testpmd> ") > self.dut.send_expect("port start all", "testpmd> ", 100) > self.dut.send_expect("show config rxtx", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") > self.check_forwarding(ports, promisc=3DTrue) > + self.check_forwarding(ports) > self.dut.send_expect("port stop all", "testpmd> ", 100) > self.dut.send_expect("set promisc all off", "testpmd> ") > self.dut.send_expect("start", "testpmd> ") > self.dut.send_expect("quit", "# ", 30) >=20 > + def test_set_allmulticast(self): > + """ > + Allmulticast mode. > + """ > + ports =3D [self.ports[0]] > + > + portmask =3D utils.create_mask(ports) > + self.pmdout.start_testpmd("Default", "--portmask=3D%s > + --port-topology=3Dloop" % portmask, socket =3D self.ports_socket) > + > + self.dut.send_expect("set promisc all off", "testpmd> ") > + self.dut.send_expect("set allmulti all off", "testpmd> ") > + self.dut.send_expect("start", "testpmd> ") > + > + self.check_forwarding(ports) > + self.check_forwarding(ports, received=3DFalse, promisc=3DTrue) > + self.check_forwarding(ports, received=3DFalse, allmulti=3DTrue) > + self.dut.send_expect("set allmulti all on", "testpmd> ") > + self.check_forwarding(ports) > + self.check_forwarding(ports, allmulti=3DTrue) > + self.check_forwarding(ports, received=3DFalse, promisc=3DTrue) > + self.dut.send_expect("set promisc all on", "testpmd> ") > + self.check_forwarding(ports) > + self.check_forwarding(ports, promisc=3DTrue) > + self.dut.send_expect("quit", "# ", 30) > + > def test_reset_queues(self): > """ > Reset RX/TX Queues. > @@ -479,6 +507,13 @@ class TestShutdownApi(TestCase): > time.sleep(8) # sleep few seconds for link stable >=20 > for port in self.ports: > + out =3D self.dut.send_expect("show port info %s" % port,= "testpmd>") > + self.verify("Link status: up" in out, > + "Wrong link status reported by the dut") > + self.verify("Link speed: %s Mbps" % config[0] in out, > + "Wrong speed reported by the dut") > + self.verify("Link duplex: %s-duplex" % config[1].lower()= in out, > + "Wrong link type reported by the dut") > out =3D self.tester.send_expect( > "ethtool %s" % > self.tester.get_interface(self.tester.get_local_port(port)), "# ") > self.verify("Speed: %sMb/s" % config[0] in out, > -- > 2.7.5