summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
Commit message (Collapse)AuthorAgeFilesLines
* testimage/oeqa: Drop testimage_dump_host functionalityThomas Roos2023-06-291-16/+2
| | | | | | | | | | | | | | | | | The intent behind these functions was to dump the system state when issues occured but it has never really worked as we'd planned. Regular monitoring as the build runs has largely replaced this as that allows a trend to be seen rather than a spot value which was never really useful. The code is bitrotting and not functioning correctly so drop it. [YOCTO #13872] RP: Reword commit message (From OE-Core rev: dea37ba49a236029da73d5cfbfc069bffc38b508) Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: fix error message about qmpChen Qi2023-06-061-2/+2
| | | | | | | | | | | | The error message is a little misleading as the qmp module is a directory with __init__.py file, not qmp.py file. Also, put the path where we try to import it from in the error message to make the message more indicative. (From OE-Core rev: 08bacbf797f6a50ae8abe8fc3455b3a15a0a94b3) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: add boot logs to do_testimage task logs in real timeMikko Rapeli2023-05-251-0/+1
| | | | | | | | | | | | | | | | | | | | | Complex boot sequences take a lot of time to reach serial console login. In our case boot involves multiple bootloaders like u-boot and grub, then hypervisors like xen, then initramfs images which do things like validating secure boot and encrypting the main rootfs. All these happen before main rootfs serial console login prompt is reached and thus many things can go wrong, including race conditions, hangs and deadlocks, and thus logging the details is important for development. This change adds the qemu serial console logs to do_testimage task logs while they are being read out. The logs are not added to bitbake output. This enables debugging and tracing the do_testimage via task log file while the boot and tests are running. (From OE-Core rev: cb62fae6ea3e411643395b12e56c363ce4d73e5d) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: avoid leaking server_socketMikko Rapeli2023-05-221-0/+1
| | | | | | | | | | | close() the server_socket before qemusock replaces it. (From OE-Core rev: be7bbbeeb44158b181d1abc5a4d7871a9045fdd6) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: support serial console login via qemu stdoutMikko Rapeli2023-05-221-11/+19
| | | | | | | | | | | | | | | | runqemu script works with qemu machines which provide login and serial console to the qemu process stdout. Add the same support to qemurunner so that testing with testimage.bbclass is possible. Default qemu machines provide serial console boot logs and login via socket to qemu process but I don't see a reason why qemu process stdout should not be supported too since they work with runqemu as well. (From OE-Core rev: a3d4b80c5b4cce933c759d023c75b8671c56fe12) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: whitespace and indentation cleanupsEnrico Jörns2023-03-311-7/+7
| | | | | | | (From OE-Core rev: 4922221d1259e2f78233f17bb901cdac5b9aa520) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: fix undefined TimeoutExpiredEnrico Jörns2023-03-311-1/+1
| | | | | | | (From OE-Core rev: 19ae3f4440b09d4cfe4bc589d859d476168541bd) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: limit precision of timing debugging outputEnrico Jörns2023-03-311-7/+7
| | | | | | | | | | | | | * There is no need to be that precise. It just irritates in the logs. * There is also no point in printing plain time.time() value a single time while only using formatted printout everywhere else, thus remove it. * Use %d for printing integer times (From OE-Core rev: f0988cb8cf8d03708490cca4eba345492ef78d52) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: replace hard-coded user 'root' in debug outputEnrico Jörns2023-03-311-2/+2
| | | | | | | | | | | | Since login user is configurable with boot_patterns['send_login_user'], unconditionally using 'root' in the debug message can be confusing. Also fix the debug message to say 'Logged in' instead of 'Logged'. (From OE-Core rev: 900e3d42b918b5a33d8d952b3a8078fbe72ba98f) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa qemurunner.py: try to avoid reading one character at a timeMikko Rapeli2023-02-101-0/+2
| | | | | | | | | | | | Read from serial console with a small delay to bundle data to e.g. full lines. Reading one character at a time is not needed and causes busy looping. (From OE-Core rev: 0049f6757f6f956fb4cc77b3df6a672c20b53cf4) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa qemurunner.py: add timeout to QMP callsMikko Rapeli2023-02-101-0/+3
| | | | | | | | | | | | | | | | When a qemu machine hangs, the QMP calls can hang for ever too, and when this happens any failing test commands from ssh runner may be followed by dump_monitor() calls which then also hang. Hangs followed by hangs. Use runqemutime at setup and run_monitor() specific timeout for later calls. (From OE-Core rev: 3a07bdf77dc6ecbf4c620b051dd032abaaf1e4ff) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa qemurunner: read more data at a time from serialMikko Rapeli2023-02-101-1/+3
| | | | | | | | | | | | Use a short sleep to bundle serial console reads so that we are not reading one character at a time which reduces busy looping. (From OE-Core rev: cafe65d8cf7544edbd387f7f5f6d77c64c6b18fa) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: do not use Popen.poll() when terminating runqemu with a signalAlexander Kanavin2023-02-011-4/+7
| | | | | | | | | | | | | | | This does not actually guarantee that the child runqemu process has completely exited: poll() may return prematurely while the SIGTERM handler in runqemu is still running. This thwarts the rest of the processing, and may terminate the handler before it completes. Use Popen.communicate() instead: this is what python documentation recommends as well: https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate (From OE-Core rev: cd3e55606c427287f37585c5d7cde936471e52f4) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: use IP address from command lineMikko Rapeli2022-11-221-2/+2
| | | | | | | | (From OE-Core rev: 44ab760c8ad7889b92019ec9341dfbec425ea4c0) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: implement vmdk images supportSergei Zhmylev2022-11-221-1/+5
| | | | | | | | | | | | | Qemurunner should not pass rootfs to runqemu in case rootfs is not a filesystem itself. Some images could be built into some disk format like vmdk and this commit makes qemurunner handle such images properly. (From OE-Core rev: 5aea74046cf4c1aa7fa9e2402788d662268ccf53) Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: support setting slirp host IP addressMikko Rapeli2022-11-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | By default host side IP address is not set and qemu listens on all IP addresses on the host machine which is not a good idea when images have root login enabled without password. It make sense to listen only on localhost IP address 127.0.0.1 using config change like: QB_SLIRP_OPT = "-netdev user,id=net0,hostfwd=tcp:127.0.0.1:2222-:22" This config works for qemu itself, but breaks runqemu which tries to parse the host side port number from qemu process command line arguments. So change the runqemu side hostfwd parsing for port number to ignore the host IP address field. Reviewed-by: Quentin Schulz <foss+yocto@0leil.net> (From OE-Core rev: bdbd52082eb26f418000eb4e424baae9babc272c) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: update exception class for QMP API changesRoss Burton2022-11-111-1/+1
| | | | | | | | (From OE-Core rev: c1841ab1e7b4e078cea77001e83e733764bb65ea) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/qemurunner: Work around possible control character contaminationRichard Purdie2022-09-131-8/+13
| | | | | | | | | | | | | | | | | Using a binary string as the login banner search expression is fraught with risks. We've seen cases on the autobuilder where "login:" is clearly shown but the code hasn't triggered. The most likely cause is hidden control characters in the output causing the search to fail. Take the opportunity to remove the horrible binary string search, at the expense of decoding the bootlog multiple times. Tweak the logging so we can know which log was printed (self.msg or bootlog) just in case this isn't the issue and we need more information in future. (From OE-Core rev: 91b9e30e08695e715ef14c3df7471e8c99f9deb5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: qemurunner: Report UNIX Epoch timestamp on loginJoshua Watt2022-09-121-2/+2
| | | | | | | | | | | | | | Updates the log message printed when login banner is seen in QEMU to report the UNIX Epoch time in addition to the human readable time. This makes it much easier and accurate to correlate logs with the guest, in particular with the guest journalctl which prints log timestamps in human readable format and the oeqa SSH debug logging which prints the UNIX Epoch. (From OE-Core rev: 275b6f3c8d0eeafa3902c48a49655491a89c47bc) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Update to match qmp changesRichard Purdie2022-09-091-3/+4
| | | | | | | | | | | | | Upstream made changes to the qmp module. We need to use the legacy one for now since that matches the interface we use, ultimately we likely need to update our code. Also fix the generic exception handler to show the actual exception which helps debugging when something does break. (From OE-Core rev: 6e90b0d909d3c8b1be5cb19f2411cd0e89735c84) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: add run_serial() commentRoss Burton2022-08-231-0/+2
| | | | | | | | | Add a comment explaining the non-obvious return codes. (From OE-Core rev: 6572baffa02ba6b8a686490d55af17cacb528920) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemuboot/runqemu: fully form the ip= kernel parameterAlexander Kanavin2022-01-111-1/+1
| | | | | | | | | | | New systemd is actually parsing this in systemd-network-generator and fails if it is not fully formed. 'off' means 'static ip, do nothing': https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt (From OE-Core rev: 2cf12c8dde0f05917797f8b4a80883dc0647b95d) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemu: install qmp module without hardcoding the python version in oeqa scriptsAlexander Kanavin2021-10-131-1/+1
| | | | | | | (From OE-Core rev: 6d3f55ea8f7190e6825dc72424088658cbc0a13c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Use oe._exit(), not sys.exit()Richard Purdie2021-09-261-1/+1
| | | | | | | | | sys.exit will cause finally statements and other code to run at exit. Since we're using os.fork() here, os._exit() is apprioriate in this codepath. (From OE-Core rev: ec08498ff29de9ccd23be88b9d7af3dab6bbb81e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: handle getOutput() having nothing to readAlexander Kanavin2021-08-271-1/+4
| | | | | | | (From OE-Core rev: f4abfdeea175cfcadd6f73a69a676632ab4334a6) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: print output from runqemu/qemu-system in stop()Alexander Kanavin2021-08-271-0/+2
| | | | | | | | | | | | | | This is done when starting up qemu has failed, but is not done when qemu started ok, but fails later in QMP communication. Output from runqemu does contain valuable information to find out why, so rather than fix all the QMP fails to include it, let's just print it in stop(). (From OE-Core rev: 6e2bf68e4401db747484c2c8ba0f77500b1d2d49) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Handle files no longer existing gracefullyRichard Purdie2021-07-111-6/+9
| | | | | | | | | Files in /proc/xxx/map_files/ may no longer exist, just ignore this rather than raising an exception. (From OE-Core rev: fb1027896a263cd91e2378a4e97dbdf0807b306b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: add support qmp cmd argsSaul Wold2021-07-021-2/+6
| | | | | | | | | | | This will enable passing arguments to qmp commands for those that require additional information (From OE-Core rev: 4d34676b6226a34df2877adbeea25abb5b2a31be) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Add info log for qemu startupSaul Wold2021-06-271-0/+8
| | | | | | | | | | | | | | | | | Add a couple of logging info to track time between activities, first is from after the Popen(launch_cmd) to after qmp.connect(), second is from qmp.connect() to the release of the qemu via the qmp("cont") command this includes the mmap() activity. Example output: QMP connected to QEMU at 06/24/21 11:11:56 and took 0.9556229114532471 seconds from launch QMP released QEMU at 06/24/21 11:11:56 and took 0.26789021492004395 seconds from connect (From OE-Core rev: 547f49230ba4ebeefe5b696e0460ebaffa8e91e6) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: add second qmp portSaul Wold2021-06-221-0/+6
| | | | | | | | | | | | This will allow for direct ssh connection without breaking the first one that is used for monitoring. The "nowait" option will cause qmp server connection to NOT block waiting. (From OE-Core rev: 40f09e184afd42decf2f924896fef03beacddc4b) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Increase startup timeout 120 -> 300Richard Purdie2021-06-111-1/+1
| | | | | | | | | | We now spend time copying the VM image into a tmpfs and with IO load on the system, the time + the boot time of the VM can take longer than 120s. Increase the timeout to match the added overhead of copying the image file. (From OE-Core rev: a40087c966af5ffb9309e1ddfdb3d06973e0bddd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Try to ensure mmap'd libs are paged inRichard Purdie2021-06-111-1/+18
| | | | | | | | | | | | | | | | | | | We've seeing issues where IO load appears to cause strange failures due to timeouts within qemu. One theory for these is that it is is hitting hard page faults at in-opportune moments which cause timing problems within the VM. This patch is a bit of a hack which tries to ensure the data is paged in at a point when we know we can take the time delays (waiting for the QMP start signal). Whilst this isn't ideal, it does seem to improve things on the autobuilder and shouldn't harm anything. The code figures out which files to read my looking at the mmap'd files the process has open from /proc. On Centos7 systems these files are not user readable, if that is the case we just skip them. (From OE-Core rev: e77844314d09ceff9c22338d366519928f4f7284) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Improve timeout handlingRichard Purdie2021-06-011-28/+22
| | | | | | | | | | We had debugging for qemu faiing to start which was no longer reachable after the QMP changes. Reorder the code to enable this debugging to work again which may allow insight into autobuilder failures in this area. (From OE-Core rev: 8fac8c61565977c775d8ede5bddc856b7767a3e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Improve handling of run_serial for shutdown commandsRichard Purdie2021-05-091-1/+6
| | | | | | | | | | | When running a shutdown command, the serial port can close without the command returning. This is seen as the socket being readable but having no data. Change the way this case is handled in the code to avoid tracebacks. (From OE-Core rev: 396a3ba884820d040c91f7592daf20ac28c49b5d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Fix binary vs str issueRichard Purdie2021-05-091-2/+2
| | | | | | | | | | | | | | The recent logging changes for qemurunner showed up as errors on the autobuilder where decode couldn't be called on the returned string. Since the code returns binary data, return b'' instead of '' to match to avoid tracebacks. One of these cases was newly added, copied from the other which has been there for a long time, always broken. (From OE-Core rev: b8995b27db265b0a0b2d2ca595915f70f9f96e07) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: change warning to infoSaul Wold2021-05-061-1/+1
| | | | | | | | | | | This information is useful, but should not be a warning level. [YOCTO #14382] (From OE-Core rev: cd17d8bb00be1ecb7c92ab13eb8b162807aefed9) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Handle path length issues for qmp socketRichard Purdie2021-05-061-24/+32
| | | | | | | | | | | | | | | | | | After the addition of the qmp socket, runqemu started failing: ERROR - Failed to run qemu: qemu-system-aarch64: -qmp unix:/home/yocto/actions-runner-meta-openembedded/_work/meta-openembedded/meta-openembedded/yoe/build/tmp/.3eg5fiid,server,wait: UNIX socket path '/home/yocto/actions-runner-meta-openembedded/_work/meta-openembedded/meta-openembedded/yoe/build/tmp/.3eg5fiid' is too long Path must be less than 108 bytes To avoid this, run qemu within tmpdir and use a relative path to the socket. This avoids having to patch the socket code within qemu. Update the client code to chdir and only use a relative path to the socket to match. (From OE-Core rev: 5c56e72fca18dc942f5c1fd377e98d46ae0126f1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Improve logging thread exit handling for qemu shutdown testRichard Purdie2021-05-061-1/+11
| | | | | | | | | | | | | | | Rather than totally disabling the logging, inform it we're about to exit so we can log messages over the exit cleanly too. This aids debugging. It also avoids a race where the logging handler could still error whilst shutting down. Also remove a race window by notificing the handler of the shutdown first, before triggering it. This removes a race window I watched in local testing. (From OE-Core rev: 0e19f31a1005f94105e1cef252abfffcef2aafad) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Add support for qmp commandsSaul Wold2021-04-271-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Qemu Machine Protocol [0] extending the current dump process for Host and Target. The commands are added in the testimage.bbclass. Currently, we setup qemu to stall until qmp gets connected and sends the initialization and continue commands, this works correctly. If the UNIX Socket does not exist, we wait an timeout to ensure to socket file is created. With this version, the monitor_dumper is created in OEQemuTarget but then set in OESSHTarget as that's where we get the SSH failure happens. Python's @property is used to create a setter/getter type of setup in OESSHTarget to get overridden by OEQemuTarget. By default the data is currently dumped to files for each command in TMPDIR/log/runtime-hostdump/<date>_qmp/unknown_<seq>_qemu_monitor as this is the naming convenstion in the dump.py code. We use the qmp.py from qemu, which needs to get installed in the recipe-sysroot-native of the target image. [0] https://github.com/qemu/qemu/blob/master/docs/interop/qmp-spec.txt (From OE-Core rev: 42af4cd2df72fc8ed9deb3fde4312909842fcf91) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* 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>
* runqemu: correct forcing of ttyS0Jon Mason2021-03-111-1/+1
| | | | | | | | | | | | | Some platforms do not use ttyS* for their serial consoles (e.g., qemuarm and qemuarm64). The hardcoding of this can cause issues. Modify runqemu to use the serial consoles defined in SERIAL_CONSOLES instead of hardcoding. (From OE-Core rev: 9dea4cd2f9f46ab3a75562639a22d8f56b4d26af) Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I746d56de5669c955c5e29d3ded70c0a4d3171f17 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Increase serial timeoutRichard Purdie2020-09-201-1/+1
| | | | | | | | | | | | | | | | | Increase the serial login timeout from 60 to 120s. This seems like a long time, however for a qemumips image with systemd+PAM and openssh, (e.g. core-image-sato-sdk + DISTRO=poky-altcfg), the getty connects to systemd's pam module which waits on logind and 45s for all this to happen at the same time as things like ssh key generation happens is not unknown. Increase the timeout to match the longer times we know these things can take in the worst case scenarios since we're tired of intermittent issues related to the serial login affecting the autobuilder. (From OE-Core rev: d8b4292db741de660f756dfb766210814d587b7a) 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>
* oeqa/utils/qemurunner: Fix missing pid file tracebacksRichard Purdie2020-07-141-1/+1
| | | | | | | | | One element of the error message guarded against None as a value but I missed the other, fix this. (From OE-Core rev: dbce6baec68d7658453b8c44159e1d1fef746151) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Add extra debug info when qemu fails to startRichard Purdie2020-07-131-0/+9
| | | | | | | | | | | | When qemu fails to start we're struggling to work out why. Add more debug info which can at least confirm/rule out various things. This code is only on the error handling path and more info shoudl help us debug issues. (From OE-Core rev: 3001d0d8f3429e5ff0c37ea7192e85e7001cdb32) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Ensure pid location is deterministicRichard Purdie2020-07-131-2/+4
| | | | | | | | | | | | The pid location could vary due to changes in cwd as only a filename is specified, not a full path. This in theory could be resulting in some of our autobuilder failures. Whilst its difficult to know if this is causing a problem, Using a full path removes any question of such an issue. (From OE-Core rev: 55c186ff410c99570242478b99ac24ebc40aa6bd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: fix ip fallback detectionKonrad Weihmann2020-05-301-1/+1
| | | | | | | | | | | | | | When falling back from detecting ip from /proc/./cmdline the output of runqemu is acutally 'Network configuration: ip=192.168.7.2::192.168.7.1::255.255.255.0' which doesn't match the given regex and leading to run failure, although IP is detectable. Fix regex by inserting an optional 'ip=' prefix to first IP (From OE-Core rev: 75f2471d15fab024775c59cb70c54e3f25f9ae72) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Clean up failure handlingRichard Purdie2020-04-261-3/+8
| | | | | | | | | | | | | | | If you fail to setup the tap devices, runqemu will error quickly however stdout/stderr are not shown to the user, instead a SystemExit traceback is shown. This could explain some long since unexplained failures on the autobuilder. Rework the error handling so SystemExit isn't used and the standard log failure messages can be shown. The code could likely ultimatley need some restructuring to work effectively. (From OE-Core rev: 57ccf1e3bb320bd28a2d106c98f4706434c3075a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: enable ovmf supportKonrad Weihmann2020-04-241-1/+4
| | | | | | | | | | Add support for running wic images with EFI as testimage. Introduces a variable called QEMU_USE_OVMF for configuration. (From OE-Core rev: 3af8aaff68ed332d812ea7dc184d392700ad7882) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Don't print a warning for harmless exceptionRichard Purdie2020-03-241-1/+2
| | | | | | | | | Printing a warning for something which is harmless just causes the people monitoring the autobuilder more work. Silently ignore this race. (From OE-Core rev: 2246c8d2466d3876fd1b27fd1943aa4bbf28e14e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>