aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-09-22 16:05:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-25 14:16:46 +0100
commit39ffa0f3779305c5e8ef86fe4572e961c5912021 (patch)
treeb2e955617fbf4bc1b4a30b6cce46176807bcb68c /meta/lib/oeqa
parent073610af04be326f9245ca91714526b390fb72cd (diff)
downloadopenembedded-core-contrib-39ffa0f3779305c5e8ef86fe4572e961c5912021.tar.gz
qemurunner: print tail qemu log in case bootlog is empty
There are cases where the 'while loop' waiting for login prompt fails and the bootlog variable does not get populated, thus use the the new qemurunner member (self.msg) which stores all output coming from the qemu process. [YOCTO #12113] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 427ae23b1b..6bae3882d6 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -51,6 +51,7 @@ class QemuRunner:
self.logged = False
self.thread = None
self.use_kvm = use_kvm
+ self.msg = ''
self.runqemutime = 120
self.qemu_pidfile = 'pidfile_'+str(os.getpid())
@@ -79,6 +80,7 @@ class QemuRunner:
# because is possible to have control characters
msg = msg.decode("utf-8", errors='ignore')
msg = re_control_char.sub('', msg)
+ self.msg += msg
with codecs.open(self.logfile, "a", encoding="utf-8") as f:
f.write("%s" % msg)
@@ -307,9 +309,12 @@ class QemuRunner:
sock.close()
stopread = True
+
if not reachedlogin:
self.logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
- lines = "\n".join(bootlog.splitlines()[-25:])
+ tail = lambda l: "\n".join(l.splitlines()[-25:])
+ # in case bootlog is empty, use tail qemu log store at self.msg
+ lines = tail(bootlog if bootlog else self.msg)
self.logger.info("Last 25 lines of text:\n%s" % lines)
self.logger.info("Check full boot log: %s" % self.logfile)
self._dump_host()
' href='#n245'>245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339