summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-09 17:47:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-10 09:53:32 +0100
commitef7e7b446a5d3bbc82b3df7118318ad249423581 (patch)
tree958ce598adb3619d381cdf24418d7d9715ee968d /meta/lib/oeqa/utils/qemurunner.py
parent36d62753146da6649d1455df9ccb9ffc0140dd5c (diff)
downloadpoky-ef7e7b446a5d3bbc82b3df7118318ad249423581.tar.gz
oeqa/qemurunner: Add newlines serial workaround
We're struggling with the 6.5 kernel as the serial port getty doesn't appears sometimes leading to failures in CI. Add a workaround of sending some newlines as a way of unblocking the kernel/release issues whilst we try and work out how to get to the bottom of the issue. (From OE-Core rev: 0a65f0d272895ba13c8c133ee71f3605d765a8a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 5fed705977..554946e2d7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -444,9 +444,11 @@ class QemuRunner:
444 self.logger.debug("Waiting at most %d seconds for login banner (%s)" % 444 self.logger.debug("Waiting at most %d seconds for login banner (%s)" %
445 (self.boottime, time.strftime("%D %H:%M:%S"))) 445 (self.boottime, time.strftime("%D %H:%M:%S")))
446 endtime = time.time() + self.boottime 446 endtime = time.time() + self.boottime
447 newlinetime = time.time() + 120
447 filelist = [self.server_socket, self.runqemu.stdout] 448 filelist = [self.server_socket, self.runqemu.stdout]
448 reachedlogin = False 449 reachedlogin = False
449 stopread = False 450 stopread = False
451 sentnewlines = False
450 qemusock = None 452 qemusock = None
451 bootlog = b'' 453 bootlog = b''
452 data = b'' 454 data = b''
@@ -455,6 +457,16 @@ class QemuRunner:
455 sread, swrite, serror = select.select(filelist, [], [], 5) 457 sread, swrite, serror = select.select(filelist, [], [], 5)
456 except InterruptedError: 458 except InterruptedError:
457 continue 459 continue
460 # With the 6.5 kernel, the serial port getty sometimes fails to appear, the data
461 # appears lost in some buffer somewhere. Wait two minutes, then if we've not had a login,
462 # try and provoke one. This is a workaround until we can work out the root cause.
463 if time.time() > newlinetime and not sentnewlines:
464 self.logger.warning('Probing the serial port to wake it up!')
465 try:
466 self.server_socket.sendall(bytes("\n\n", "utf-8"))
467 except BrokenPipeError as e:
468 self.logger.debug('Probe failed %s' % repr(e))
469 sentnewlines = True
458 for file in sread: 470 for file in sread:
459 if file is self.server_socket: 471 if file is self.server_socket:
460 qemusock, addr = self.server_socket.accept() 472 qemusock, addr = self.server_socket.accept()