summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-07-10 14:33:32 +0300
committerSaul Wold <sgw@linux.intel.com>2013-07-15 10:29:26 -0700
commite828571683333e6f18ed56a84e114b5e54975bc7 (patch)
treea1d120e3d2f9804d2273db480d1fc87329928e1f
parent1988de2fad86e8e34070ed6573a7be09fff5c0a2 (diff)
downloadopenembedded-core-e828571683333e6f18ed56a84e114b5e54975bc7.tar.gz
openembedded-core-e828571683333e6f18ed56a84e114b5e54975bc7.tar.bz2
openembedded-core-e828571683333e6f18ed56a84e114b5e54975bc7.zip
testimage.bbclass, lib/oeqa/utils/qemurunner.py: make boot timeout configurable and increase it
On a loaded host (such as an AB setup where multiple builds run) the 200 seconds timeout might not be enough to reach the login prompt. Also make it configurable so we can set it from local.conf/auto.conf Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rw-r--r--meta/classes/testimage.bbclass6
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py10
2 files changed, 11 insertions, 5 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 35c6811c89..f66f514904 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -7,6 +7,8 @@ DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "ping ssh connman rpm smart gcc xor
TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
+TEST_QEMUBOOT_TIMEOUT ?= "500"
+
python do_testimage() {
testimage_main(d)
}
@@ -65,6 +67,10 @@ def 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)
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 3132b6871b..ec9298863a 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -10,7 +10,7 @@ from oeqa.utils.oeqemuconsole import oeQemuConsole
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
@@ -25,6 +25,7 @@ class QemuRunner:
self.display = display
self.tmpdir = tmpdir
self.logfile = logfile
+ self.boottime = boottime
def launch(self, qemuparams = None):
@@ -49,7 +50,6 @@ class QemuRunner:
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:
@@ -59,8 +59,8 @@ class QemuRunner:
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")
@@ -80,7 +80,7 @@ class QemuRunner:
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)