[dts] [PATCH V1] tests/ice_ecpri: optimize script

Song Jiale songx.jiale at intel.com
Mon Jan 30 12:24:28 CET 2023


there may be logs containing "#" in dmesg information, this "#" is not 
the expected value, which will affect the subsequent tests and cause the
case to fail randomly.

Signed-off-by: Song Jiale <songx.jiale at intel.com>
---
 tests/TestSuite_ice_ecpri.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_ice_ecpri.py b/tests/TestSuite_ice_ecpri.py
index 4b60478b..580641e5 100644
--- a/tests/TestSuite_ice_ecpri.py
+++ b/tests/TestSuite_ice_ecpri.py
@@ -342,7 +342,7 @@ class TestICEEcpri(TestCase):
         self.pmd_output.execute_cmd(
             "port config 0 udp_tunnel_port add ecpri {}".format(self.right_ecpri)
         )
-        self.new_session.send_expect("dmesg -c", "#")
+        self.new_session.send_expect("dmesg -c", "[~|~\]]# ")
         self.new_session.send_expect(
             "ip link add vx0 type vxlan id 100 local 1.1.1.1 remote "
             "2.2.2.2 dev {} dstport 0x1234".format(self.pf_interface),
@@ -350,19 +350,19 @@ class TestICEEcpri(TestCase):
         )
         self.new_session.send_expect("ifconfig vx0 up", "#")
         self.new_session.send_expect("ifconfig vx0 down", "#")
-        out = self.new_session.send_expect("dmesg", "#")
+        out = self.new_session.send_expect("dmesg", "[~|~\]]# ")
         self.verify(
             "Cannot config tunnel, the capability is used by DCF" in out,
             "port can used by another thread!",
         )
         # delete eCPRI port config and test
-        self.new_session.send_expect("dmesg -c", "#")
+        self.new_session.send_expect("dmesg -c", "[~|~\]]# ")
         self.pmd_output.execute_cmd(
             "port config 0 udp_tunnel_port rm ecpri {}".format(self.right_ecpri)
         )
         self.new_session.send_expect("ifconfig vx0 up", "#")
         self.new_session.send_expect("ifconfig vx0 down", "# ")
-        out = self.new_session.send_expect("dmesg", "#")
+        out = self.new_session.send_expect("dmesg", "[~|~\]]# ")
         self.verify(
             "Cannot config tunnel, the capability is used by DCF" not in out,
             "port can't used by another thread!",
-- 
2.25.1



More information about the dts mailing list