summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemutinyrunner.py
Commit message (Collapse)AuthorAgeFilesLines
* oeqa/runqemu: Support RUNQEMU_TMPFS_DIR as a location to copy snapshot images toRichard Purdie2021-04-061-1/+5
| | | | | | | | | | | | | | | | | | We have a working theory that IO queues on the autobuilder are impacting runtime testing under qemu, particularly async writes which inice does not influence. We already pass the snapshot option to qemu which copies the image and runs out of the copy. Add in the ability to copy the image to a specificed location which can be a tmpfs. This means that writes to the image would no longer be blocked by other writes to disk in the system. Preliminary tests show that this does improve the qemu errors at the expense of sometimes showing qemu startup timeouts as on a loaded system with a large test image, it can take longer than 120s to copy the image to tmpfs. Having a most consistent failure mode for loaded tests is probably desireable though. (From OE-Core rev: fd1c26ab426c3699ffd8082b83d65a84c8eb8bff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Add priority/nice information for running processesRichard Purdie2020-07-221-1/+1
| | | | | | | | | | We're seeing failures due to system load. In theory we've set process nice levels which should compensate for this. Add debugging so we can find out if they're being correctly applied. (From OE-Core rev: 1e4e345bba8216b9b5623682206a7dae7cad261c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib+scripts: Convert to SPDX license headersRichard Purdie2019-05-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: set timeout to 60s for run_serialRobert Yang2019-01-071-1/+1
| | | | | | | | | | The 5s timeout for non-kvm is too short, especially when the load is high, which leads to unexpected errors, so set timeout to 60s by default. (From OE-Core rev: 8197d0f638a760fc03062c7a9009117d083d7ead) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Clean up logger handlingRichard Purdie2017-11-091-1/+2
| | | | | | | | | | | | | | | | | | The logger handling in oeqa was confused at best. This patch: a) Passes in a logger through various qemu runner pieces b) Uses that logger consistently in the code c) Creates a logger for QemuRunner outside the bitbake namespace meaning we don't conflict with the tinfoil logging changes The result of this is more consistency. For runtime tests in testimage, the logs always contain the debug info, nothing is shwon on the console. For the oe-selftests, logs are intercepted and only shown if the test fails. (From OE-Core rev: 4ff678137a55b93c9ba2cbffda34335ba859f704) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: allow persistent image writes in runqemu()Patrick Ohly2017-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, QemuRunner avoids modifying the image files that it boots into by enabling the qemu snapshot mode. However, some tests may want to test changes that must persists across reboots, so this mode should be optional. This can be combined by copying the image file to a temporary location first and then booting with that copy. It's also useful when testing with additional drives attached to a virtual machine. QemuTinyRunner doesn't use the snapshot parameter and therefore ignores the new parameter. Long term, a better way of passing these various configuration parameters should be used, and perhaps QemuRunner and QemuTinyRunner can be merged into one again to avoid code duplication. But for now the patch follows the exiting style. Also beware that QemuTarget.start() now acts in two different modes (with or without explicit launch command), and depending on that mode parameters like discard_writes must be ignored, i.e. not get passed to launch(). (From OE-Core rev: 969d079a33a57f5a8f7af86d7bab04d35ab07584) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: tolerate interrupted select() while waiting for qemuPatrick Ohly2017-03-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, the OEQA utility code aborts with: ... File ".../meta/lib/oeqa/utils/qemurunner.py", line 131, in start return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams) File ".../meta/lib/oeqa/utils/qemurunner.py", line 259, in launch sread, swrite, serror = select.select(socklist, [], [], 5) InterruptedError: [Errno 4] Interrupted system call strace shows that this is because of a SIGWINCH: Connection from 127.0.0.1:52668 select(21, [20], [], [], {5, 0}) = ? ERESTARTNOHAND (To be restarted if no handler) --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} --- This is related to some special conditions: * whether qemu opens a graphical console window (enabled in Poky by default) * where that window gets opened * whether the window manager changes the size of the shell window (mine is a tiling window manager and reorders and resizes windows automatically) Ignoring the interrupted system calls avoids the problem. Code elsewhere (for example, run() in ssh.py) already does the same thing. (From OE-Core rev: 44fe106baf5fd5aebe26c5f28004e2b18d839b7c) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: configurable timeout for run_serial()Patrick Ohly2017-03-271-3/+5
| | | | | | | | | | | | | | | | | | | Some commands might need to run longer than the default timeout of five seconds. If that occurred, run_serial() returned with a status code of zero (sic!) and no other indication of what went wrong. Now the timeout is configurable (with five still the default) and an explicit warning ("<<< run_serial(): command timed out after 5 seconds without output >>>") gets appended at the end of the data returned to the caller. While at it, the logic for checking for the timeout was updated a bit because both implementations could overshoot the timeout when entering select() right before the final deadline. (From OE-Core rev: accf0362f964cc9d6330b6e52e83d748d890521f) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: add runqemuparams argument to commands.runqemuEd Bartosh2017-03-081-1/+1
| | | | | | | | | | | | | | | Added possibility to pass additional runqemu parameters down the stack of APIs: commands.runqemu -> QemuTarget.start -> QemuRunner.start This will be used to pass ovmf parameter in testing of efi wic images under qemu. (From OE-Core rev: 5aa4b5a10fb8191cd3453d09701c8beeff9a952f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py/qemutinyrunner.py: remove runqemu-internalRobert Yang2016-09-091-1/+1
| | | | | | | | | There is no runqemu-internal any more. (From OE-Core rev: 14bacf7203ab7a638b67eb143225d8c75bbb703d) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: start() add remaining args SimpleRemoteTarget and QemuTinyRunnerAníbal Limón2016-08-101-2/+2
| | | | | | | | | | | Now Runner's support extra_bootargs for the kernel so add extra_bootparams to the start() methods to avoid exception. (From OE-Core rev: 4c28c03a2322fbcb9a5c268b08eaeb71d940ee04) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Complete transition to python3Richard Purdie2016-06-021-1/+1
| | | | | | | | | This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Update to use python3 command pipeline decodingRichard Purdie2016-06-021-2/+2
| | | | | | | | | | | In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. (From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Update to modern exception syntaxRichard Purdie2016-05-211-1/+1
| | | | | | | | | Update older exception syntax to modern one required by python 3. Compatible with python 2.7. (From OE-Core rev: d13f0ac614f1d1e2ef2c8ddc71cbfcf76a8dc3f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/oeqa: Update for print statements and file() -> open() for python3uninative-1.0Richard Purdie2016-05-161-1/+1
| | | | | | | | Found some more syntax cleanups needed for python3. (From OE-Core rev: 1181d86e8707c5b8e8d43d5e785d7d9cf01fa491) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Add runner for poky-tiny qemu.Lucian Musat2015-04-101-0/+170
The connection and commands are done via serial. (From OE-Core rev: bc6ac3058d7adb6f1bf87e57deaa50347f452e59) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>