summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index cda43aad8c..63fc6f6b53 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -30,6 +30,8 @@ control_range = list(range(0,32))+list(range(127,160))
30control_chars = [chr(x) for x in control_range 30control_chars = [chr(x) for x in control_range
31 if chr(x) not in string.printable] 31 if chr(x) not in string.printable]
32re_control_char = re.compile('[%s]' % re.escape("".join(control_chars))) 32re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
33# Regex to remove the ANSI (color) control codes from console strings in order to match the text only
34re_vt100 = re.compile(r'(\x1b\[|\x9b)[^@-_a-z]*[@-_a-z]|\x1b[@-_a-z]')
33 35
34def getOutput(o): 36def getOutput(o):
35 import fcntl 37 import fcntl
@@ -681,7 +683,7 @@ class QemuRunner:
681 time.sleep(0.1) 683 time.sleep(0.1)
682 answer = self.server_socket.recv(1024) 684 answer = self.server_socket.recv(1024)
683 if answer: 685 if answer:
684 data += answer.decode('utf-8') 686 data += re_vt100.sub("", answer.decode('utf-8'))
685 # Search the prompt to stop 687 # Search the prompt to stop
686 if re.search(self.boot_patterns['search_cmd_finished'], data): 688 if re.search(self.boot_patterns['search_cmd_finished'], data):
687 break 689 break