summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
Commit message (Collapse)AuthorAgeFilesLines
* oeqa/postactions: Do not use -l option with dfKhem Raj2024-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | -l option is specific to df provided by coreutils, if df applet from busybox is used then it does not work and fails like below Fixes df: invalid option -- 'l' BusyBox v1.36.1 () multi-call binary. Usage: df [-PkmhT] [-t TYPE] [FILESYSTEM]... DEBUG: [Command returned '1' after 0.71 seconds] DEBUG: Command: df -hl Status: 1 Output: df: invalid option -- 'l' it seems worth a compromise to show remote mounted filesystems if any during ptests and it works with both df implementations (From OE-Core rev: 75cc1ea4348a2294fdc5ab20530fcff27056ff06) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: Fix error on calls to run_monitorEilís 'pidge' Ní Fhlannagáin2024-03-071-2/+2
| | | | | | | | | | | | | | | | | | | A change in QEMUMonitorProtocol.cmd() requires that we either pass in kwargs instead of an argument dict or move to cmd_raw() cmd() was renamed to cmd_raw() (and command() was renamed to cmd()) See: https://github.com/qemu/qemu/commit/37274707f6f3868fae7e0055d9a703006fc142d0 https://github.com/qemu/qemu/commit/684750ab4f8a3ad69512b71532408be3ac2547d4 My concern with this patch is that I haven't seen this come up with utils/dump.py which also uses QemuMonitor's run_monitor. If it is occuring, this should fix issues there as well (From OE-Core rev: 9665d38ab60c1c3b27887c2b1a6396f13a1b33ea) Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/lib/utils/postactions: fix host disk usage stats retrievalAlexis Lothoré2024-02-291-1/+1
| | | | | | | | | | | | | | | | | | The recently introduced postactions module can raise, on failing ptests, the following warning: WARNING: core-image-ptest-glib-2.0-1.0-r0 do_testimage: Can not get host disk usage: [Errno 2] No such file or directory: '/usr/bin/df' The issue is likely not happening because of df absence (to be confirmed amongst the variety of workers) but because of the wrong path. Fix it by letting subprocess search for df, passing only the binary name. To make it work, we also have to reset the environment, otherwise the environment configured before running bitbake will be used, and search will fail. (From OE-Core rev: da7cc5def2839a0e15d07244f858847479c12caa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/postactions: testimage: add host disk usage stat as post actionAlexis Lothoré2024-02-271-1/+12
| | | | | | | | | | | | | | Since the target under test can be a virtualized guest, when some tests fail because of disk usage (see [1]), also fetch disk usage statistics from host to allow checking whether a host disk space saturation could affect running tests. [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15220 (From OE-Core rev: 2ab3a0935b1e7a016402f149da1fc01b38d7af55) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/postactions: add target disk usage stat as post actionAlexis Lothoré2024-02-271-1/+16
| | | | | | | | | | | | | In order to debug issues related to disk space (see [1]), add a failed tests post action to retrieve disk usage on the target. Rely on the test context object to run the corresponding command onto the target [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15220 (From OE-Core rev: 637e216b0e5191571270aa07e1f50a6e41a8c08f) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/postactions: isolate directory creation in dedicated actionAlexis Lothoré2024-02-271-6/+10
| | | | | | | | | | | | | | | In order to be able to create actions that could store new files during failed test post actions, we need to split artifacts directory creation from artifacts retrieval. Create a new dedicated action to create artifacts main directory so we can add actions creating files in this new directory, without worrying about actions order if at least this action is set first. (From OE-Core rev: 5d796586a9342f4f984494a5b493dbaf77af7026) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: create a list of failed test post actionsAlexis Lothoré2024-02-271-0/+68
| | | | | | | | | | | | | | | | | | | | | testimage is able to detect whenever a test run leads to some tests failing, and execute some actions in this case. The only action currently defined in such case is to retrieve artifacts from the target under test, as listed in TESTIMAGE_FAILED_QA_ARTIFACTS In order to be able to add multiple actions, define a central function to gather all "post actions" to run whenever a test has failed (run_failed_tests_post_actions). This function contains a table listing all functions to be called whenever a test fails. Any function in this table will be provided with bitbake internal data dictionary ("d") and the current runtime testing context ("tc"). Isolate all this feature in a dedicated postactions.py file inherited by testimage. This patch does not bring any functional change. (From OE-Core rev: c01aa8df0613a103859b4431d3cc5056b2fef1b8) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: share get_json_result_dir helperAlexis Lothoré2024-02-271-0/+7
| | | | | | | | | | | | | Multiple places in oeqa need to get the log output path, and redefine a small helper to accomplish this Define this helper in lib/oeqa/utils/__init__.py and import it wherever needed to allow using it. (From OE-Core rev: 01b1a6a5a4e7cede4d23a981b5144ae9c8306274) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Handle rare shutdown raceRichard Purdie2024-01-301-2/+6
| | | | | | | | | | | | | | The pid file can disappear when qemu is shutting down leading to a file not found race before it is read. Tweak the code to handle this and fix a rare but annoying race error case. [YOCTO #15036] (From OE-Core rev: 8c07aac9d55f92fe5fbe3cab9f006efecf266328) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: more cleanups for output blockingAlex Bennée2023-12-211-8/+12
| | | | | | | | | | | | | | | | | If we are only tracking stdout and are not using self.readsock we end up throwing an exception blocking further action from the thread. Fix this by checking self.readsock is not None first. While we are at it split even into fd, event to make things clearer and handle the fail path of stringify_event by echoing the hex value of the unknown flag. (From OE-Core rev: 5e58737c66090fe009ec49296f3e7d687eb05766) Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Mikko Rapeli <mikko.rapeli@linaro.org> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Improve handling of serial port output blockingRichard Purdie2023-12-201-29/+69
| | | | | | | | | | | Similar to stdout in the previous commit, we need to ensure serial output if written is read and put somewhere, else qemu might block on writes to the serial port leading to hangs in the kernel. Use our existing logging thread to log data when run_serial is not in use. (From OE-Core rev: 05761282ba31e4ba3594f7321e2162d01fe12a5f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Improve stdout logging handlingRichard Purdie2023-12-201-22/+32
| | | | | | | | | | | We need to ensure we read from and log the output from qemu stdout as otherwise the buffers can fill and block, leading qemu to hang. Use our existing logging thread to do this. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> (From OE-Core rev: a9c46ee014ef1e6436b39fdd4fd15d15388ea795) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: remove unused importRoss Burton2023-12-131-1/+0
| | | | | | | | | | | Removes unused logging import (From OE-Core rev: 1f21509a2fadb66888589e9946b34dddf5becc72) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Drop newlines serial workaroundRichard Purdie2023-10-151-12/+0
| | | | | | | | | Drop the newlines serial workaround, it doesn't seem to fix things enough of the time to be useful. (From OE-Core rev: 6cd57b2d148c5de7839d52d8cec359e4a10e0cd6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: ensure tag matches regex before getting its fieldsAlexis Lothoré2023-10-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever we ask gitarchive to retrieve test results for specific revisions, we first do a "large" search in get_tags, which uses glob patterns with git ls-remote, and then we filter received tags with a regex to parse the tags fields. Currently gitarchive assumes that all tags returned by get_tags will match the regex. This assumption is wrong (for example searching "master-next" in get_tags may return some tags like "abelloni/master-next), and leads then to exception when we try to retrieve tags fields: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 78, in <module> sys.exit(main()) ^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 72, in main ret = args.func(args, logger) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/scripts/lib/resulttool/regression.py", line 315, in regression_git revs2 = gitarchive.get_test_revs(logger, repo, tag_name, branch=args.branch2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/meta/lib/oeqa/utils/gitarchive.py", line 246, in get_test_revs fields, runs = get_test_runs(log, repo, tag_name, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/meta/lib/oeqa/utils/gitarchive.py", line 238, in get_test_runs groups = m.groupdict() Fix this exception by merely skipping those additionals tags which won't match the regex (From OE-Core rev: 8b5ace47372e958db9e4abb23378947fb02f6fc2) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: fix tag pattern searchingAlexis Lothoré2023-10-111-1/+1
| | | | | | | | | | | | | | | | Whenever we ask gitarchive to search for tags, we can provide it with a pattern (containing glob patterns). However, when searching for example for tags matching branch master-next, it can find more tags which does not correspond exactly to branch master-next (e.g. abelloni/master-next tags will match). Prevent those additional tags from being fetched by gitarchive by using a more specific pattern: prefix user-provided pattern with "refs/tags" (From OE-Core rev: c24b7ea28021da48aa8f3498a9b899f595efde56) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Ensure we retry after BrokenPipeErrorRichard Purdie2023-10-111-1/+1
| | | | | | | | | | | | If the BrokenPipeError occurs when writing to the serial port to wake it up, defer the write and try again (which will happen on the 5s timeout of the select call). Why it should return ESHUTDOWN and then work later I'm not sure but it does appear to make it work. For now we need 'working' QA tests whilst the issue is debugged. (From OE-Core rev: ea9e6ba0ab31a0b20012c283aa768496a50b527a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Add extra logging when console doesn't appearRichard Purdie2023-10-101-0/+10
| | | | | | | | | | | | | If the console doesn't appear, breifly sleep and try an extra read. This is a useful debugging trick which we may as well preserve in the code. We're already failing at this point so extra data is useful. This means if we perturb things on the other port, we may gain useful logging insight. (From OE-Core rev: be3724854947ded160789d0353b7efb8c593040f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu/qemurunner: Use nodelay with tcp serial connectionsRichard Purdie2023-10-101-0/+1
| | | | | | | | | This disables Nagle's algorithm for our tcp serial connections which may be causing data transfer issues. (From OE-Core rev: f8eff4c427881a98333fdf7c42f66ed6603e4f03) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Add newlines serial workaroundRichard Purdie2023-10-101-0/+12
| | | | | | | | | | | We're struggling with the 6.5 kernel as the serial port getty doesn't appears sometimes leading to failures in CI. Add a workaround of sending some newlines as a way of unblocking the kernel/release issues whilst we try and work out how to get to the bottom of the issue. (From OE-Core rev: 0a65f0d272895ba13c8c133ee71f3605d765a8a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: detect login prompt without without utf-8 conversionMikko Rapeli2023-10-081-2/+1
| | | | | | | | | | | In case utf-8 conversion of the serial console data is flaky due to bad characters in the stream. (From OE-Core rev: 3f4921ced1e2aae546ff7cef232eec3e214c28be) 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: Show both the login console log and all logging upon failureRichard Purdie2023-10-041-3/+2
| | | | | | | | | It is unclear when things fail which output was on which serial port. Improve the output to show the last lines of both data to improve debugging. (From OE-Core rev: 605938b3bb19dcf6c7218648b4d16df9eaa675fc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Log the second serial console as well as the firstRichard Purdie2023-10-041-6/+3
| | | | | | | | | | To aid debugging, always log the second serial console as well as the first to a seperate log file. This should make it clearer what happened when we see test failures. (From OE-Core rev: 372cd58fe672726900af80f3e65a108984da2750) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Use backslashreplace with utf8 to make invalid characters clearRichard Purdie2023-10-041-2/+2
| | | | | | | | | Switch to the backslashreplace error handling when decoding strings so that invalid characters are clear in the stream to improve debugging. (From OE-Core rev: 8ec86d46f736ec3e625b741e97545377c79414ee) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Skip conversion from/to binary data for logfileRichard Purdie2023-10-041-4/+3
| | | | | | | | | | | | | There is no point in decoding binary data only to encode it again risking conversion issues. Write the raw data to the log file as binary and skip the conversion. Also always update self.msg even if a logfile isn't specified to improve logging/debug. (From OE-Core rev: b5d67471dddd198723c4f711747783a33e8e5987) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: Handle broken commit counts in results repoRichard Purdie2023-09-281-1/+9
| | | | | | | | | | | | | | | | | | | | | The test results repository contains tags like: master/64501-g65c94ca3196e5ef3344a469fea8e30444f2e967a/0 master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/3 master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/2 master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/1 master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/0 where the commit count is correct in one case and not in the others. This causes assertion errors in the current code. Add in some code to work around these historical issues where the commit counts are low. (From OE-Core rev: d51fc5c8c469730885af7bbde7122032de411d89) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Streamline oe-selftest startup timeRichard Purdie2023-09-221-2/+4
| | | | | | | | | | | | | | "bitbake -e" executions from get_bb_var calls are slow and slow down oe-selftest startup. Rationalise the code to avoid them and minimise the number of "parsing" locations we use by caching key variables and passing them around more. This was particularly problematic with oe-selftest -j usage since it would have multiple bitbake -e executions per process making parallel usage particularly slow. (From OE-Core rev: 3689cadeb07d76e66f97d890e844f899f69666fe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: replace warning with info when reading local tagsAlexis Lothoré2023-08-241-1/+1
| | | | | | | | | | | | Whenever a script needs to list tags, if it falls back to the third method (reading local tags only), it emits a warning. While this warning is useful for future diagnostic if some tagging issues re-appear, it makes buildperf autobuilds status as "Passed with warnings", which is not desirable (From OE-Core rev: b2c1d8a83a3b2134a8f9a445cbf00103e63ed0b3) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: fall back to local tags when listing existing tagsAlexis Lothoré2023-08-231-9/+16
| | | | | | | | | | | | | | | | | | | e9cff55e73cc has switched tag listing from bare "git tag" to "git ls-remote" to make sure not to miss remote tags which are not fetched locally. This mechanism first checks for configured remote repository, next for possibly passed url, and then fails if none worked. However there are still cases where no remote repository is configured and no url is provided (for instance: buildperf tests use an empty git directory to store tests). Fix those cases by putting back the old behavior (local tags check) as last resort, with at least a warning for future diagnostics if we still encounter tagging issues Fixes: e9cff55e73cc ("oeqa/utils/gitarchive: fix tag computation when creating archive") (From OE-Core rev: 34e1f845687d2f7169f5d6c1bb54e1a7ab5412c4) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: allow to pass a logger to get_tagsAlexis Lothoré2023-08-231-5/+6
| | | | | | | | | | Propagate a "log" parameter to get_tags in order to know what method is used to retrieve existing tags (From OE-Core rev: f8212eda45444dfb330e4d930eeceefde936adeb) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: fix tag computation when creating archiveAlexis Lothoré2023-08-211-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sporadic errors have been observed in autobuilder when trying to store new tests results: error: failed to push some refs to 'push.yoctoproject.org:yocto-testresults' hint: Updates were rejected because the tag already exists in the remote. The new tag name is generated by gitarchive based on known tags from the repository (learnt with git tag). In autobuilder case, this repository is a shallow clone, so git tag only returns most recent tags, which mean we could miss some older tags which exist in remote but not locally. In this case, gitarchive will likely create a tag which already exists in remote, and so will fail to push Fix this tag duplication by using git ls-remote to learn about existing tags instead of git tag. To do so, create a helper ("get_tags") which manages both nominal case (target directory is a git repository with a proper remote) and fallback case (target directory is not from a clone, no remote has been configured) Fixes [YOCTO #15140] (From OE-Core rev: 9cbbe9689866158825a7ae774b7965b41ff5c461) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "oeqa/utils/gitarchive: fix tag computation when creating archive"Richard Purdie2023-08-161-4/+2
| | | | | | | | This reverts commit 5a0a7da85a3acfd4a20a07478eabefdab60f313a. This caused failres on the build performance tests on the autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/gitarchive: fix tag computation when creating archiveAlexis Lothoré2023-08-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Sporadic errors have been observed in autobuilder when trying to store new tests results: error: failed to push some refs to 'push.yoctoproject.org:yocto-testresults' hint: Updates were rejected because the tag already exists in the remote. The new tag name is generated by gitarchive based on known tags from the repository (learnt with git tag). In autobuilder case, this repository is a shallow clone, so git tag only returns most recent tags, which mean we could miss some older tags which exist in remote but not locally. In this case, gitarchive will likely create a tag which already exists in remote, and so will fail to push Fix this tag duplication by using git ls-remote to learn about existing tags instead of git tag. Two places which wrongly read only local tags has been identified in gitarchive: expand_tag_strings and get_test_runs Fixes [YOCTO #15140] (From OE-Core rev: 5a0a7da85a3acfd4a20a07478eabefdab60f313a) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/nfs: allow requesting non-udp portsAnuj Mittal2023-07-261-2/+2
| | | | | | | | | Allows setting up NFS over TCP as well. (From OE-Core rev: e1ff9b9a3b7f7924aea67d2024581bea2e916036) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/ltp: rewrote LTP testcase and parserRoss Burton2023-07-211-22/+40
| | | | | | | | | | | | | | | | The LTP test reporting appears to be a little fragile so I tried to make it more reliable. Primarily this is done by not passing -p to runltp, which results in machine-readable logfiles instead of human-readable. These are easier to parse and have more context in, so we can also report correctly skipped tests. (From OE-Core rev: d585c6062fcf452e7288f6f8fb540fd92cbf5ea2) 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>
* testimage/oeqa: Drop testimage_dump_host functionalityThomas Roos2023-06-292-35/+3
| | | | | | | | | | | | | | | | | 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>
* oeqa/logparser: Fix ptest No-section exceptionRichard Purdie2023-06-171-1/+4
| | | | | | | | | | | | | | | | | | | | | Occasionally we see: File "/media/build/poky/meta/lib/oeqa/runtime/cases/ptest.py", line 27, in test_ptestrunner_expectfail self.do_ptestrunner() File "/media/build/poky/meta/lib/oeqa/runtime/cases/ptest.py", line 77, in do_ptestrunner results, sections = parser.parse(ptest_runner_log) File "/media/build/poky/meta/lib/oeqa/utils/logparser.py", line 80, in parse self.results[current_section['name']][result.group(1).strip()] = t KeyError: 'No-section' which occurs when there are "results" outside the main log section. The strace tests do then upon failure as they dump logs there. Add code to avoid the tracebacks and just make them warnings. (From OE-Core rev: d9bf95d8cfb123f9d992fd2a95099bdcece97be8) 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/runtime/ptest: Make returning no test results a failureRichard Purdie2023-05-031-2/+2
| | | | | | | | | | | | | Ensure that even if a ptests results section is empty, the log parser adds that empty section. Then ensure that empty sections trigger warnings. This means if a ptest suddently stops returning any results, we notice and see warnings about it. This has gone unnoticed on the autobuilder far too many times so is very much worth highlighting as a regression. We shouldn't have empty ptests. (From OE-Core rev: 5ad0cf57b41ec7f44647a03bc568d0b24906cc8d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/metadata.py: Fix running oe-selftest running with no distro setThomas Roos2023-04-201-3/+3
| | | | | | | | | | | | This will use default values when no distribution is set. [YOCTO #15086] (From OE-Core rev: 888fe63b46efceeff08dbe8c4f66fec33d06cb7a) Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: whitespace and indentation cleanupsEnrico Jörns2023-03-312-8/+8
| | | | | | | (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/utils/commands: remove unused importsEnrico Jörns2023-03-311-3/+0
| | | | | | | (From OE-Core rev: 0c00b5cdd57c3d9c47d4780d6627c74221911b72) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands: fix usage of undefined EPIPEEnrico Jörns2023-03-311-1/+2
| | | | | | | (From OE-Core rev: 1cb17e37e275794e26debed2d171c2394d8bb945) 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>