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 D84C6A00C5; Sun, 26 Apr 2020 11:52:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C650C1BFEB; Sun, 26 Apr 2020 11:52:01 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id F13331BF9E for ; Sun, 26 Apr 2020 11:51:59 +0200 (CEST) IronPort-SDR: m6yGCng/nX0fa/SM0R3L5glnSAh3LWv+Vt1ohl60hYH48Qw5goUdnhA1fwAZXbjzfQQXERiqch 5Nm+7lo8gVJA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2020 02:51:59 -0700 IronPort-SDR: 0AsXa67KXqogBaq5WmJP7T5ZBgqbQKf4zwQGwJgo6j49jg264bBpH4TOW0jst/fuq1kKV44ekL QQqUxuY2hlTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,319,1583222400"; d="scan'208";a="403931902" Received: from unknown (HELO dpdk-test60-xueqin.sh.intel.com) ([10.67.117.106]) by orsmga004.jf.intel.com with ESMTP; 26 Apr 2020 02:51:57 -0700 From: Xueqin Lin To: dts@dpdk.org Cc: Xueqin Lin Date: Sat, 25 Apr 2020 23:53:24 -0400 Message-Id: <1587873204-163786-1-git-send-email-xueqin.lin@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [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" Signed-off-by: Xueqin Lin --- tests/TestSuite_shutdown_api.py | 43 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) 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 = output.get_pmd_stats(portid) return stats - def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False): + def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False, allmulti=False, vlan_strip=False): if ports is None: ports = self.ports if len(ports) == 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 - def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False, vlan_strip=False): + def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False, allmulti=False, vlan_strip=False): """ Send packages according to parameters. """ @@ -117,7 +117,8 @@ class TestShutdownApi(TestCase): # when promisc is true, destination mac should be fake if promisc: dmac = "00:00:00:00:00:01" - + if allmulti: + dmac = "01:00:00:33:00:01" if vlan: padding = pktSize - HEADER_SIZE['eth'] - HEADER_SIZE['ip'] -4 pkg = 'Ether(src="%s", dst="%s")/Dot1Q(vlan=1)/IP()/Raw(load="P" * %d)' % (smac, dmac, padding) @@ -366,17 +367,44 @@ class TestShutdownApi(TestCase): print((" !!! DEBUG IT: " + e.message)) self.verify(False, e.message) + self.check_forwarding(ports, received=False, promisc=True) 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=True) + 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) + def test_set_allmulticast(self): + """ + Allmulticast mode. + """ + ports = [self.ports[0]] + + portmask = utils.create_mask(ports) + self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % portmask, socket = 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=False, promisc=True) + self.check_forwarding(ports, received=False, allmulti=True) + self.dut.send_expect("set allmulti all on", "testpmd> ") + self.check_forwarding(ports) + self.check_forwarding(ports, allmulti=True) + self.check_forwarding(ports, received=False, promisc=True) + self.dut.send_expect("set promisc all on", "testpmd> ") + self.check_forwarding(ports) + self.check_forwarding(ports, promisc=True) + 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 for port in self.ports: + out = 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 = 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