test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yu Jiang <yux.jiang@intel.com>
To: xueqin.lin@intel.com, dts@dpdk.org
Cc: Yu Jiang <yux.jiang@intel.com>
Subject: [dts][PATCH V1] Optimize script: wait_link_status_up after start testpmd
Date: Fri, 19 Nov 2021 15:33:41 +0800	[thread overview]
Message-ID: <1637307221-16387-1-git-send-email-yux.jiang@intel.com> (raw)

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 <yux.jiang@intel.com>
---
 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


             reply	other threads:[~2021-11-19  7:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  7:33 Yu Jiang [this message]
2021-11-19  8:31 ` Jiang, YuX
2021-11-20  7:50 Yu Jiang
2021-11-22  6:24 Yu Jiang
2021-11-22  7:41 ` Jiang, YuX
2021-11-22 14:51   ` Tu, Lijuan
2021-11-24  8:33 Yu Jiang
2021-11-30  3:28 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1637307221-16387-1-git-send-email-yux.jiang@intel.com \
    --to=yux.jiang@intel.com \
    --cc=dts@dpdk.org \
    --cc=xueqin.lin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).