TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
+TEST_QEMUBOOT_TIMEOUT ?= "500"
+
python do_testimage() {
testimage_main(d)
}
qemu.tmpdir = d.getVar("TMPDIR", True)
qemu.display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True)
qemu.logfile = os.path.join(testdir, "qemu_boot_log.%s" % d.getVar('DATETIME', True))
+ try:
+ qemu.boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True))
+ except ValueError:
+ qemu.boottime = 500
bb.note("DISPLAY value: %s" % qemu.display)
bb.note("rootfs file: %s" % rootfs)
class QemuRunner:
- def __init__(self, machine, rootfs, display = None, tmpdir = None, logfile = None):
+ def __init__(self, machine, rootfs, display = None, tmpdir = None, logfile = None, boottime = 400):
# Popen object
self.runqemu = None
self.display = display
self.tmpdir = tmpdir
self.logfile = logfile
+ self.boottime = boottime
def launch(self, qemuparams = None):
self.runqemu = subprocess.Popen(launch_cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,preexec_fn=os.setpgrp)
bb.note("runqemu started, pid is %s" % self.runqemu.pid)
- # wait at most 30 seconds until qemu pid appears
bb.note("waiting at most 60 seconds for qemu pid")
endtime = time.time() + 60
while not self.is_alive() and time.time() < endtime:
bb.note("qemu started - qemu procces pid is %s" % self.qemupid)
console = oeQemuConsole(self.streampath, self.logfile)
- bb.note("Waiting at most 200 seconds for login banner")
- (match, text) = console.read_all_timeout("login:", 200)
+ bb.note("Waiting at most %d seconds for login banner" % self.boottime )
+ (match, text) = console.read_all_timeout("login:", self.boottime)
if match:
bb.note("Reached login banner")
return False
else:
console.close()
- bb.note("Target didn't reached login boot in 120 seconds")
+ bb.note("Target didn't reached login boot in %d seconds" % self.boottime)
lines = "\n".join(text.splitlines()[-5:])
bb.note("Last 5 lines of text:\n%s" % lines)
bb.note("Check full boot log: %s" % self.logfile)