From 360ba927efec8c6edcae878d6b3c1611b7feb149 Mon Sep 17 00:00:00 2001 From: lcheng Date: Wed, 28 Feb 2024 13:00:34 +0800 Subject: [PATCH] Fix dmesg log issue In some test environments, we will get the following dmesg log: dmesg log:[01;31m[K[[m[K[01;31m[KS[m[K[01;31m[Ku[m[K[01;31m [Kn[m[K[01;31m[K [m[K[01;31m[KF[m[K[01;31m[Ke[m[K[01;31m[Kb [m[K[01;31m[K [m[K[01; ... So update code to avoid this issue. Signed-off-by: lcheng --- virttest/utils_misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py index eff7bcc910..ae4203da3f 100644 --- a/virttest/utils_misc.py +++ b/virttest/utils_misc.py @@ -3258,7 +3258,7 @@ def __get_kernel_messages(level_check=3, session=None): output: multi-line string containing all read messages status: exit code of read command """ - cmd = "dmesg -T -l %s|grep ." % ",".join( + cmd = "dmesg -T -l %s|grep . --color never" % ",".join( map(str, xrange(0, int(level_check)))) if session: environ = "guest"