summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/testimage.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-13 10:29:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-13 23:03:36 +0100
commit2d96d3f5ace29bb886d825609bd042310019a620 (patch)
tree15309efefd7d7181d8344f8eefba3fb7ad7a7720 /meta/classes-recipe/testimage.bbclass
parent8d5cb0399f255eca906e960ce7fe05c62a24e891 (diff)
downloadpoky-2d96d3f5ace29bb886d825609bd042310019a620.tar.gz
selftest/qemurunner: Work around possible control character contamination
Using a binary string as the login banner search expression is fraught with risks. We've seen cases on the autobuilder where "login:" is clearly shown but the code hasn't triggered. The most likely cause is hidden control characters in the output causing the search to fail. Take the opportunity to remove the horrible binary string search, at the expense of decoding the bootlog multiple times. Tweak the logging so we can know which log was printed (self.msg or bootlog) just in case this isn't the issue and we need more information in future. (From OE-Core rev: 91b9e30e08695e715ef14c3df7471e8c99f9deb5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/testimage.bbclass')
-rw-r--r--meta/classes-recipe/testimage.bbclass6
1 files changed, 1 insertions, 5 deletions
diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 8d2fab21df..819c7d2bf4 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -189,11 +189,7 @@ def get_testimage_boot_patterns(d):
189 search_login_succeeded,search_cmd_finished\n Make sure your TESTIMAGE_BOOT_PATTERNS=%s \ 189 search_login_succeeded,search_cmd_finished\n Make sure your TESTIMAGE_BOOT_PATTERNS=%s \
190 contains an accepted flag.' % d.getVar('TESTIMAGE_BOOT_PATTERNS')) 190 contains an accepted flag.' % d.getVar('TESTIMAGE_BOOT_PATTERNS'))
191 return 191 return
192 # We know boot prompt is searched through in binary format, others might be expressions 192 boot_patterns[flag] = flagval.encode().decode('unicode-escape')
193 if flag == 'search_reached_prompt':
194 boot_patterns[flag] = flagval.encode()
195 else:
196 boot_patterns[flag] = flagval.encode().decode('unicode-escape')
197 return boot_patterns 193 return boot_patterns
198 194
199 195