[V1] tests/ice_ecpri: optimize script

Message ID 20230130112428.4011515-1-songx.jiale@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/ice_ecpri: optimize script |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test success Testing OK

Commit Message

Jiale, SongX Jan. 30, 2023, 11:24 a.m. UTC
  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@intel.com>
---
 tests/TestSuite_ice_ecpri.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Tu, Lijuan March 7, 2023, 3:54 a.m. UTC | #1
On Mon, 30 Jan 2023 11:24:28 +0000, Song Jiale <songx.jiale@intel.com> wrote:
> 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@intel.com>


Applied, thanks
  

Patch

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!",