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 78121A3201 for ; Mon, 21 Oct 2019 11:07:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6ED154C8E; Mon, 21 Oct 2019 11:07:58 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9295423D for ; Mon, 21 Oct 2019 11:07:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Oct 2019 02:07:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,323,1566889200"; d="scan'208";a="227255382" Received: from unknown (HELO dpdk-wenjielx-KVM190.icx.intel.com) ([10.238.54.190]) by fmsmga002.fm.intel.com with ESMTP; 21 Oct 2019 02:07:55 -0700 From: Wenjie Li To: dts@dpdk.org Cc: Wenjie Li Date: Mon, 21 Oct 2019 17:59:06 +0000 Message-Id: <1571680746-51972-1-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [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" 1. disable promisc packets 2. check the ports are UP before sending packets Signed-off-by: Wenjie Li --- tests/TestSuite_shutdown_api.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 = self.pmdout.wait_link_status_up('all') + self.verify(res is True, 'there have port link is down') + port0_stats = self.get_stats(txPort) gp0tx_pkts, gp0tx_bytes = [port0_stats['TX-packets'], port0_stats['TX-bytes']] port1_stats = self.get_stats(rxPort) @@ -188,6 +192,7 @@ class TestShutdownApi(TestCase): Stop and Restar. """ self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("start", "testpmd> ") @@ -244,6 +249,7 @@ class TestShutdownApi(TestCase): testcorelist = self.dut.get_core_list("1S/8C/1T", socket=self.ports_socket) self.pmdout.start_testpmd(testcorelist, "--portmask=%s --port-topology=loop" % utils.create_mask([self.ports[0]]), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") fwdcoremask = utils.create_mask(testcorelist[-3:]) self.dut.send_expect("port stop all", "testpmd> ", 100) @@ -269,6 +275,7 @@ class TestShutdownApi(TestCase): self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) else: self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") out = self.dut.send_expect("show config rxtx", "testpmd> ") Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S) crc_keep_temp = [] @@ -306,6 +313,7 @@ class TestShutdownApi(TestCase): return self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") out = 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): jumbo_size = 2048 self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + 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_size, "testpmd> ") out = 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=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") 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=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + 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 rxd 1024", "testpmd> ") @@ -434,6 +445,7 @@ class TestShutdownApi(TestCase): Change the Number of rxd/txd. """ self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + 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 rxd 1024", "testpmd> ") @@ -464,6 +476,7 @@ class TestShutdownApi(TestCase): Change RX/TX thresholds """ self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + 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 txfreet 32", "testpmd> ") @@ -500,6 +513,7 @@ class TestShutdownApi(TestCase): stress_iterations = 10 self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") tgenInput = [] for port in self.ports: @@ -525,6 +539,7 @@ class TestShutdownApi(TestCase): return self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket) + self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("start", "testpmd>") -- 2.17.1