From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0A88A0C4B; Fri, 19 Nov 2021 08:34:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1B1D40143; Fri, 19 Nov 2021 08:34:17 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 2C43B40140 for ; Fri, 19 Nov 2021 08:34:14 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10172"; a="214402406" X-IronPort-AV: E=Sophos;i="5.87,246,1631602800"; d="scan'208";a="214402406" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2021 23:34:14 -0800 X-IronPort-AV: E=Sophos;i="5.87,246,1631602800"; d="scan'208";a="673118275" Received: from unknown (HELO localhost.localdomain) ([10.240.183.163]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 18 Nov 2021 23:34:05 -0800 From: Yu Jiang To: xueqin.lin@intel.com, dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1] Optimize script: wait_link_status_up after start testpmd Date: Fri, 19 Nov 2021 15:33:41 +0800 Message-Id: <1637307221-16387-1-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 tests/external_memory&mtu_update&scatter&vxlan: optimize script: wait_link_status_up after start testpmd to enhance script robustness Signed-off-by: Yu Jiang --- tests/TestSuite_external_memory.py | 4 +++- tests/TestSuite_mtu_update.py | 1 + tests/TestSuite_scatter.py | 1 + tests/TestSuite_vxlan.py | 18 +++++++++++------- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_external_memory.py b/tests/TestSuite_external_memory.py index f68a9a6..2f862fa 100644 --- a/tests/TestSuite_external_memory.py +++ b/tests/TestSuite_external_memory.py @@ -40,6 +40,7 @@ import time import framework.utils as utils from framework.test_case import TestCase +from framework.pmd_output import PmdOutput class TestExternalMemory(TestCase): @@ -49,7 +50,7 @@ class TestExternalMemory(TestCase): """ self.dut_ports = self.dut.get_ports(self.nic) self.verify(len(self.dut_ports) >= 2, "Insufficient ports") - + self.pmdout = PmdOutput(self.dut) self.app_testpmd_path = self.dut.apps_name['test-pmd'] def set_up(self): @@ -134,6 +135,7 @@ class TestExternalMemory(TestCase): def verifier_result(self): self.dut.send_expect("start", "testpmd>",10) + self.pmdout.wait_link_status_up(self.dut_ports[0]) self.scapy_send_packet(20) out = self.dut.send_expect("stop", "testpmd>", 10) diff --git a/tests/TestSuite_mtu_update.py b/tests/TestSuite_mtu_update.py index ad13a8a..f16eb8e 100644 --- a/tests/TestSuite_mtu_update.py +++ b/tests/TestSuite_mtu_update.py @@ -235,6 +235,7 @@ class TestMtuUpdate(TestCase): self.exec("port start all") self.exec("set fwd mac") self.exec("start") + self.pmdout.wait_link_status_up(self.dut_ports[0]) """ On 1G NICs, when the jubmo frame MTU set > 1500, the software adjust it to MTU+4. """ diff --git a/tests/TestSuite_scatter.py b/tests/TestSuite_scatter.py index 85312c5..499c0ab 100644 --- a/tests/TestSuite_scatter.py +++ b/tests/TestSuite_scatter.py @@ -110,6 +110,7 @@ class TestScatter(TestCase): self.dut.send_expect("set fwd mac", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") + self.pmdout.wait_link_status_up(self.port) for offset in [-1, 0, 1, 4, 5]: ret = self.scatter_pktgen_send_packet(self.mbsize + offset) diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py index 1442578..9605c89 100644 --- a/tests/TestSuite_vxlan.py +++ b/tests/TestSuite_vxlan.py @@ -472,8 +472,8 @@ class TestVxlan(TestCase): config.outer_mac_dst = self.dut_port_mac config.create_pcap() self.dut.send_expect("start", "testpmd>", 10) + self.pmdout.wait_link_status_up(self.dut_port) config.send_pcap(self.tester_iface) - # check whether detect vxlan type out = self.dut.get_session_output(timeout=2) print(out) @@ -572,6 +572,7 @@ class TestVxlan(TestCase): # send vxlan packet config.create_pcap() self.dut.send_expect("start", "testpmd>", 10) + self.pmdout.wait_link_status_up(self.dut_port) config.send_pcap(self.tester_iface) out = self.dut.get_session_output(timeout=2) print(out) @@ -606,7 +607,7 @@ class TestVxlan(TestCase): self.dut.send_expect("set verbose 1", "testpmd>", 10) self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) - + self.pmdout.wait_link_status_up(self.dut_port) # check normal packet self.send_and_detect(outer_udp_dst=1234) # check vxlan + UDP inner packet @@ -642,7 +643,7 @@ class TestVxlan(TestCase): self.dut.send_expect("set verbose 1", "testpmd>", 10) self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) - + self.pmdout.wait_link_status_up(self.dut_port) # check normal ipv6 packet self.send_and_detect(outer_ip6_src="FE80:0:0:0:0:0:0:0", outer_ip6_dst="FE80:0:0:0:0:0:0:1", @@ -692,7 +693,7 @@ class TestVxlan(TestCase): self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) - + self.pmdout.wait_link_status_up(self.dut_port) # check normal packet + ip checksum invalid self.send_and_check(outer_ip_invalid=1, outer_udp_dst=1234) # check vxlan packet + inner ip checksum invalid @@ -754,6 +755,7 @@ class TestVxlan(TestCase): self.dut.send_expect("set fwd csum", "testpmd>", 10) self.csum_set_type('outer-ip', self.recv_port) self.csum_set_type('udp', self.recv_port) + self.csum_set_type('outer-udp', self.recv_port) self.csum_set_type('tcp', self.recv_port) self.csum_set_type('sctp', self.recv_port) self.dut.send_expect("csum parse-tunnel on %d" % @@ -761,7 +763,7 @@ class TestVxlan(TestCase): self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) - + self.pmdout.wait_link_status_up(self.dut_port) # check normal ipv6 packet self.send_and_check(outer_ip6_src="FE80:0:0:0:0:0:0:0", outer_ip6_dst="FE80:0:0:0:0:0:0:1") @@ -821,7 +823,7 @@ class TestVxlan(TestCase): self.dut.send_expect("set verbose 1", "testpmd>", 10) self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) - + self.pmdout.wait_link_status_up(self.dut_port) config = VxlanTestConfig(self) config_vlan = VxlanTestConfig(self, inner_vlan=1) config.outer_mac_dst = self.dut_port_mac @@ -892,6 +894,7 @@ class TestVxlan(TestCase): self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) + self.pmdout.wait_link_status_up(self.dut_port) rule = 'flow create {} ingress pattern eth / ipv4 / udp / vxlan vni is {} / eth dst is {} / end actions pf ' \ '/ queue index {} / end'.format(self.dut_port, config.vni, @@ -1048,7 +1051,7 @@ class TestVxlan(TestCase): self.dut.send_expect("set fwd io", "testpmd>", 10) self.dut.send_expect("start", "testpmd>", 10) - + self.pmdout.wait_link_status_up(self.dut_port) if BIDIRECT: wirespeed = self.wirespeed(self.nic, PACKET_LEN, 2) else: @@ -1131,6 +1134,7 @@ class TestVxlan(TestCase): self.dut.send_expect("set fwd csum", "testpmd>", 10) self.enable_vxlan(self.dut_port) self.enable_vxlan(self.recv_port) + self.pmdout.wait_link_status_up(self.dut_port) # redirect flow to another queue by tunnel filter rule_config = { -- 2.7.4