Commit Graph

413 Commits

Author SHA1 Message Date
Khem Raj
c3235e3ae9 oeqa/postactions: Do not use -l option with df
-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: 82a0df6cc2c5b18cb48fd8c3be26a11f4016d98d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 75cc1ea4348a2294fdc5ab20530fcff27056ff06)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-19 08:34:58 -07:00
Eilís 'pidge' Ní Fhlannagáin
b9e9693cb0 qemurunner.py: Fix error on calls to run_monitor
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:
37274707f6
684750ab4f

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>
2024-03-07 17:27:51 +00:00
Alexis Lothoré
437c0721c5 oeqa/lib/utils/postactions: fix host disk usage stats retrieval
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>
2024-02-29 10:26:13 +00:00
Alexis Lothoré
5018d3a4b6 oeqa/utils/postactions: testimage: add host disk usage stat as post action
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>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
d4267a8dce oeqa/utils/postactions: add target disk usage stat as post action
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>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
9a46657a25 oeqa/utils/postactions: isolate directory creation in dedicated action
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>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
3add7b301e testimage: create a list of failed test post actions
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>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
fec128bd62 lib/oeqa: share get_json_result_dir helper
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>
2024-02-27 11:35:43 +00:00
Richard Purdie
5573fb12eb oeqa/qemurunner: Handle rare shutdown race
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>
2024-01-30 15:15:54 +00:00
Alex Bennée
4a5ef39d8a qemurunner: more cleanups for output blocking
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>
2023-12-21 10:38:30 +00:00
Richard Purdie
98b63ecc43 qemurunner: Improve handling of serial port output blocking
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>
2023-12-20 07:47:00 +00:00
Richard Purdie
d921da782a qemurunner: Improve stdout logging handling
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>
2023-12-20 07:47:00 +00:00
Ross Burton
b9eeb3b386 qemurunner: remove unused import
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>
2023-12-13 11:34:27 +00:00
Richard Purdie
ddd38a3b15 oeqa/qemurunner: Drop newlines serial workaround
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>
2023-10-15 09:11:47 +01:00
Alexis Lothoré
3c53168682 oeqa/utils/gitarchive: ensure tag matches regex before getting its fields
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>
2023-10-11 09:43:45 +01:00
Alexis Lothoré
800665612a oeqa/utils/gitarchive: fix tag pattern searching
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>
2023-10-11 09:43:45 +01:00
Richard Purdie
4411460016 oeqa/qemurunner: Ensure we retry after BrokenPipeError
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>
2023-10-11 09:39:46 +01:00
Richard Purdie
c0af426af8 oeqa/qemurunner: Add extra logging when console doesn't appear
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>
2023-10-10 09:53:32 +01:00
Richard Purdie
44b4c74cad runqemu/qemurunner: Use nodelay with tcp serial connections
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>
2023-10-10 09:53:32 +01:00
Richard Purdie
ef7e7b446a oeqa/qemurunner: Add newlines serial workaround
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>
2023-10-10 09:53:32 +01:00
Mikko Rapeli
23a50c8cca qemurunner.py: detect login prompt without without utf-8 conversion
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>
2023-10-08 13:05:25 +01:00
Richard Purdie
ce804a6797 qemurunner: Show both the login console log and all logging upon failure
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>
2023-10-04 23:05:54 +01:00
Richard Purdie
aaaa314807 qemurunner: Log the second serial console as well as the first
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>
2023-10-04 23:05:54 +01:00
Richard Purdie
4abef7a9d9 qemurunner: Use backslashreplace with utf8 to make invalid characters clear
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>
2023-10-04 23:05:54 +01:00
Richard Purdie
2305928a00 qemurunner: Skip conversion from/to binary data for logfile
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>
2023-10-04 23:05:54 +01:00
Richard Purdie
fc5a15cc64 oeqa/utils/gitarchive: Handle broken commit counts in results repo
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>
2023-09-28 12:37:47 +01:00
Richard Purdie
7e6514b28b oeqa: Streamline oe-selftest startup time
"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>
2023-09-22 07:45:17 +01:00
Alexis Lothoré
359a105de6 oeqa/utils/gitarchive: replace warning with info when reading local tags
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>
2023-08-24 13:34:34 +01:00
Alexis Lothoré
db6ace80a0 oeqa/utils/gitarchive: fall back to local tags when listing existing tags
e9cff55e73 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: e9cff55e73 ("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>
2023-08-23 22:33:39 +01:00
Alexis Lothoré
3c1ee6d8b0 oeqa/utils/gitarchive: allow to pass a logger to get_tags
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>
2023-08-23 22:33:39 +01:00
Alexis Lothoré
e9cff55e73 oeqa/utils/gitarchive: fix tag computation when creating archive
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>
2023-08-21 11:34:12 +01:00
Richard Purdie
f9dff104bd Revert "oeqa/utils/gitarchive: fix tag computation when creating archive"
This reverts commit 5a0a7da85a3acfd4a20a07478eabefdab60f313a.

This caused failres on the build performance tests on the autobuilder.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-16 07:56:15 +01:00
Alexis Lothoré
788f6a0e16 oeqa/utils/gitarchive: fix tag computation when creating archive
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>
2023-08-15 08:15:25 +01:00
Anuj Mittal
8bc29e1c87 oeqa/utils/nfs: allow requesting non-udp ports
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>
2023-07-26 20:51:00 +01:00
Ross Burton
b398c7653e oeqa/ltp: rewrote LTP testcase and parser
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>
2023-07-21 11:52:26 +01:00
Thomas Roos
f82c3bd37d testimage/oeqa: Drop testimage_dump_host functionality
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>
2023-06-29 10:57:27 +01:00
Richard Purdie
62c5556025 oeqa/logparser: Fix ptest No-section exception
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>
2023-06-17 11:50:56 +01:00
Chen Qi
5eec70a456 qemurunner.py: fix error message about qmp
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>
2023-06-06 07:41:43 +01:00
Mikko Rapeli
7fbf5fdd02 qemurunner: add boot logs to do_testimage task logs in real time
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>
2023-05-25 10:29:08 +01:00
Mikko Rapeli
c7a68ff3cc qemurunner: avoid leaking server_socket
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>
2023-05-22 10:53:47 +01:00
Mikko Rapeli
830f4cb0a6 qemurunner: support serial console login via qemu stdout
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>
2023-05-22 10:53:47 +01:00
Richard Purdie
5caf9e375f oeqa/runtime/ptest: Make returning no test results a failure
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>
2023-05-03 07:33:18 +01:00
Thomas Roos
150464e2ff oeqa/utils/metadata.py: Fix running oe-selftest running with no distro set
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>
2023-04-20 11:56:05 +01:00
Enrico Jörns
d59756912c oeqa: whitespace and indentation cleanups
(From OE-Core rev: 4922221d1259e2f78233f17bb901cdac5b9aa520)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-31 23:30:36 +01:00
Enrico Jörns
4651c42cab oeqa/utils/qemurunner: fix undefined TimeoutExpired
(From OE-Core rev: 19ae3f4440b09d4cfe4bc589d859d476168541bd)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-31 23:30:36 +01:00
Enrico Jörns
6ef891415f oeqa/utils/qemurunner: limit precision of timing debugging output
* 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>
2023-03-31 23:30:36 +01:00
Enrico Jörns
ff7b3d6810 oeqa/utils/qemurunner: replace hard-coded user 'root' in debug output
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>
2023-03-31 23:30:36 +01:00
Enrico Jörns
a5f848f0e0 oeqa/utils/commands: remove unused imports
(From OE-Core rev: 0c00b5cdd57c3d9c47d4780d6627c74221911b72)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-31 23:30:36 +01:00
Enrico Jörns
c27a505f58 oeqa/utils/commands: fix usage of undefined EPIPE
(From OE-Core rev: 1cb17e37e275794e26debed2d171c2394d8bb945)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-31 23:30:36 +01:00
Mikko Rapeli
9437c73905 oeqa qemurunner.py: try to avoid reading one character at a time
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>
2023-02-10 09:25:44 +00:00