From 2d96d3f5ace29bb886d825609bd042310019a620 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 13 Sep 2022 10:29:01 +0100 Subject: 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 --- meta/classes-recipe/testimage.bbclass | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'meta/classes-recipe/testimage.bbclass') 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): search_login_succeeded,search_cmd_finished\n Make sure your TESTIMAGE_BOOT_PATTERNS=%s \ contains an accepted flag.' % d.getVar('TESTIMAGE_BOOT_PATTERNS')) return - # We know boot prompt is searched through in binary format, others might be expressions - if flag == 'search_reached_prompt': - boot_patterns[flag] = flagval.encode() - else: - boot_patterns[flag] = flagval.encode().decode('unicode-escape') + boot_patterns[flag] = flagval.encode().decode('unicode-escape') return boot_patterns -- cgit v1.2.3-54-g00ecf