summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* oeqa/utils/gitarchive: Return tag name and improve exclude handlingRichard Purdie2024-12-091-1/+3
| | | | | | | | | | | | | Tweak the gitarchive exclude handling not to error if excluded files don't match. Also return the tagname created so that other code can then use it. (From OE-Core rev: bde2cf92e1a968e7272a194b887c331742f94d5b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1adba3430faffdf6217b6a00533a3b48a9388abc) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* resulttool: Use single space indentation in json outputRichard Purdie2024-12-091-1/+1
| | | | | | | | | | | | | Using 4 space indentation in resulted in hundreds of megabytes of extra file size in general use. Reduce this to make filesizes more managable and reduce the processing cost. Some level of indentation and spacing does make the files more readable and allows use of git diff so we need to retain some of it. (From OE-Core rev: b8be3ac506bb39665390c770f72de2ca359670b1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a274cdcaf852cca9497f0358f44dda99c06aacbe) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* selftest/reproducible: Clean up pathnamesRichard Purdie2024-12-091-1/+1
| | | | | | | | | | | | | | | | | | | There are several problems with these paths. Firstly they contain full system paths which depend upon where the test was run. These are pretty pointless and just take up a lot of space making the results files large. Secondly, they contain the same path twice. The reference and target path will always be the same thing in two different locations. Strip off the prefix and remove the duplication. This does change the output data but that can't really be avoided. It does shrink the results data and makes it more readable. (From OE-Core rev: 40b422edd954eeb917464e6baa0e952d2ed4184c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 81a44de36e864b08687451fd85aeba7c529fd7f7) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* selftest/reproducible: Drop rawlogsRichard Purdie2024-12-091-6/+0
| | | | | | | | | | | | | | | The "rawlogs" data consists of a long string of results data which is already in a structured data format. I can't see this is adding much value in duplciating the data but it does create a huge string with a lot of long problematic pathnames and inflates the results data size. I suggest we drop this data as obsolete and not necessary. (From OE-Core rev: d35e96785a07bba29a76c96f91751be12497f50c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5b2c70fab2ffa409b861d83f048b65d458d03a90) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* do_package/sstate/sstatesig: Change timestamp clamping to hash output onlyRichard Purdie2024-12-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was changing the timestamps of the files in the do_package output, particularly the files added for debug sources. This was to do two things: a) make do_package sstate more reproducible b) ensure better hash equivalence matching Unfortuately the debug source files are hardlinks into the source tree for efficiency so touching these, touches a lot of files in ${B} and ${S}. This causes unpredictable effects if compile is run again for example, or could cause compiling in the install task. The hash equivalence matching is of key importance but we can mimic that using clamping of the file timestamps in the depsig output used to generate the hashes. This patch drops the global timestamp clamping, instead allowing the files to retain their creation timestamps into sstate. This makes do_package sstate slightly less reproducibile. We could clamp the sstate timestamps but that would lead to two different sets of timestamps depending on whether the data came from sstate or not. I'd prefer to have consistent code behaviour, rather than differing behavhour depending on whether data came from sstate or not. If we wanted to have reproducibiliy and fix the "corruption" of S/B and have consistent codepaths, the only other option would be two copies of the sources, which could end up huge and seems the least desireable option. This patch therefore drops the timestamp clamping in the sstate files and tweaks the depsig data generation to clamp the timestamps for do_package instead since this seems the best compromise. I validated that rpm/deb/ipk files still generate correctly as before. (From OE-Core rev: 0e6b2c761f6d727fe21a0ce2803a0f0aef236f59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 475759fdab7200488b2a568b2ba1aa31a456d113) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* selftest/sstatetests: run CDN mirror check only onceAlexander Kanavin2024-11-301-2/+0
| | | | | | | | | | | | | The first no-fail check was an attempt to work around the old CDN's instability (and it didn't really help); it should not be necessary with the new CDN, and only delays a-full completion. (From OE-Core rev: 6ffde2643e6ee8a2a0eddca173a254dbdc4a79bb) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7f75c42b7fcf60a9ca58d3ded9047df675d76dc2) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* cve-check: fix malformed cve status description with : charactersPeter Marko2024-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CPE is not provided and character ":" is in cve status description, current code takes only last part of split function. This works only if there is no ":" in description, otherwise it drops the other split parts. Do a new split of the original string to take the whole description unchanged. This fixes following entries from world build of poky+meta-oe+meta-python: tiff-4.6.0-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2015-7313 CVE_STATUS: fixed-version: Tested with check from https://security-tracker.debian.org/tracker/CVE-2015-7313 and already 4.3.0 doesn't have the issue description: //security-tracker.debian.org/tracker/CVE-2015-7313 and already 4.3.0 doesn't have the issue corrected: Tested with check from https://security-tracker.debian.org/tracker/CVE-2015-7313 and already 4.3.0 doesn't have the issue gnupg-2.5.0-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2022-3219 CVE_STATUS: upstream-wontfix: Upstream doesn't seem to be keen on merging the proposed commit - https://dev.gnupg.org/T5993 description: //dev.gnupg.org/T5993 corrected: Upstream doesn't seem to be keen on merging the proposed commit - https://dev.gnupg.org/T5993 libyaml-0.2.5-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2024-35325 CVE_STATUS: upstream-wontfix: Upstream thinks this is a misuse (or wrong use) of the libyaml API - https://github.com/yaml/libyaml/issues/303 description: //github.com/yaml/libyaml/issues/303 corrected: Upstream thinks this is a misuse (or wrong use) of the libyaml API - https://github.com/yaml/libyaml/issues/303 libyaml-0.2.5-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2024-35326 CVE_STATUS: upstream-wontfix: Upstream thinks there is no working code that is exploitable - https://github.com/yaml/libyaml/issues/302 description: //github.com/yaml/libyaml/issues/302 corrected: Upstream thinks there is no working code that is exploitable - https://github.com/yaml/libyaml/issues/302 libyaml-0.2.5-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2024-35328 CVE_STATUS: upstream-wontfix: Upstream thinks there is no working code that is exploitable - https://github.com/yaml/libyaml/issues/302 description: //github.com/yaml/libyaml/issues/302 corrected: Upstream thinks there is no working code that is exploitable - https://github.com/yaml/libyaml/issues/302 cpio-2.15-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2023-7216 CVE_STATUS: disputed: intended behaviour, see https://lists.gnu.org/archive/html/bug-cpio/2024-03/msg00000.html description: //lists.gnu.org/archive/html/bug-cpio/2024-03/msg00000.html corrected: intended behaviour, see https://lists.gnu.org/archive/html/bug-cpio/2024-03/msg00000.html openssh-9.9p1-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2023-51767 CVE_STATUS: upstream-wontfix: It was demonstrated on modified sshd and does not exist in upstream openssh https://bugzilla.mindrot.org/show_bug.cgi?id=3656#c1. description: //bugzilla.mindrot.org/show_bug.cgi?id=3656#c1. corrected: It was demonstrated on modified sshd and does not exist in upstream openssh https://bugzilla.mindrot.org/show_bug.cgi?id=3656#c1. cups-2.4.10-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2021-25317 CVE_STATUS: not-applicable-config: This concerns /var/log/cups having lp ownership, our /var/log/cups is root:root, so this doesn't apply. description: root, so this doesn't apply. corrected: This concerns /var/log/cups having lp ownership, our /var/log/cups is root:root, so this doesn't apply. unzip-1_6.0-r0 do_cve_check: CVE_STATUS with 3 parts for CVE-2008-0888 CVE_STATUS: fixed-version: Patch from https://bugzilla.redhat.com/attachment.cgi?id=293893&action=diff applied to 6.0 source description: //bugzilla.redhat.com/attachment.cgi?id=293893&action=diff applied to 6.0 source corrected: Patch from https://bugzilla.redhat.com/attachment.cgi?id=293893&action=diff applied to 6.0 source syslog-ng-4.7.0-r0 do_cve_check: CVE_STATUS with 6 parts for CVE-2022-38725 CVE_STATUS: cpe-incorrect: cve-check wrongly matches cpe:2.3:a:oneidentity:syslog-ng:*:*:*:*:premium:*:*:* < 7.0.32 description: syslog-ng:*:*:*:*:premium:*:*:* < 7.0.32 corrected: cve-check wrongly matches cpe:2.3:a:oneidentity:syslog-ng:*:*:*:*:premium:*:*:* < 7.0.32 (From OE-Core rev: 5cd34a34879ad424f3b1637b48892d6fa037861d) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cc33dd9176726cb4b2d2f142ed1bc655da8e0a9f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* cve-check: do not skip cve status description after :Peter Marko2024-11-301-1/+1
| | | | | | | | | | | | | | | | | | Correct maxsplit parameter from 5 to 4 to not drop text if description contains ":". Example: >>> "detail: cpe:vendor:product:description:cont".split(':', 5) ['detail', ' cpe', 'vendor', 'product', 'description', 'xxx'] >>> "detail: cpe:vendor:product:description:cont".split(':', 4) ['detail', ' cpe', 'vendor', 'product', 'description:xxx'] (From OE-Core rev: 4921605aab4c9588e5c96de3afe08e9d35f51145) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3c4d8ca41ac0b429af92bf0ea84f1dfd0cda9e1f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* qemurunner: Clean up serial_lock handlingRichard Purdie2024-11-261-5/+6
| | | | | | | | | | | | Avoid "RuntimeError: release unlocked lock" since the lock shouldn't be locked even in the error path. Add a try/finally path to ensure this. (From OE-Core rev: 0d08aab2e1c1ff1a8cb41b62b2e763bb88ca8b5a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b0732ee009ca47580d1d2ad75334f4aa50e6efd5) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* lib/oe/package-manager: skip processing installed-pkgs with empty globsClaus Stovgaard2024-11-261-39/+37
| | | | | | | | | | | | | | | | | | We can skip processing the installed-pkgs file if globs is empty. This is the case if self.d.getVar for IMAGE_INSTALL_COMPLEMENTARY returns an empty string. If globs is an empty string the result from processing with empty glob in oe-pkgdata-util will always be 0 packages to install. Instead of return early on this we just skip and still generate the locale archive if needed. (From OE-Core rev: be4dbec9e79b51b9b72670291ba02c4f6d3258dd) Signed-off-by: Claus Stovgaard <claus.stovgaard@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 160c45c83d5addf01e4834cf896af871bd6fca7f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/runtime/ssh: Fix incorrect timeout fixRichard Purdie2024-11-261-2/+2
| | | | | | | | | | | I'd meant to change the command timeout in the previous change, fix the correct one. (From OE-Core rev: 41ab062f0b711e30720d0e52aab79ef387ec4f28) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bb991988cb23be2c8947171726ada321f27e6eed) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/runtime/ssh: Rework ssh timeoutRichard Purdie2024-11-261-2/+2
| | | | | | | | | | | | | | | | | | After the changes to improve this test, we keep seeing image testing ssh failures, particularly on mips. It looks like part of the problem is that on a loaded system, 5s is too short for mips to reliably establish an ssh connection. I've seen logs where it keeps timing out and fails to work, then the debug code successfully uses ssh later after everything else fails. Change the timings/retries to give slow platforms enough time to respond. (From OE-Core rev: 5158ceb4179ec53e396a57068714aea7d81e3f59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ba64ccf3ad6e40461219b72d60eb0fe5cb38fddd) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/selftest: Update the BB_HASHSERVE_UPSTREAMJose Quaresma2024-11-022-2/+2
| | | | | | | | (From OE-Core rev: d5ba3f78f340d4627cf33eca14969d61b00f5766) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* image.bbclass: Drop support for ImageQAFailed exceptions in image_qaPeter Kjellerstedt2024-10-291-13/+0
| | | | | | | | | | | | | | | | | | | | | | After commit 905e224849fbbed1719e0add231b00e2d570b3b4 (image_qa: fix error handling), any unexpected exceptions in do_image_qa() would result in a variable being set, but never used, effectively hiding the error. Since image_qa now calls oe.qa.exit_if_errors(), remove the support for oe.utils.ImageQAFailed and instead rely on the called functions to call oe.qa.handle_error() themselves. This matches what do_package_qa() does. Also update the description of do_image_qa() to explain that the called functions are expected to call oe.qa.handle_error() themselves. [ YOCTO #15601 ] (From OE-Core rev: c00ad42b6a26ceb7a2878ed2c7f6c2821fe513cc) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0c3e111c965af2bc56533633c376b70b7fa5e1de) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/selftest/gcc: Fix kex exchange identification errorHarish Sadineni2024-10-291-0/+2
| | | | | | | | | | | | | | | | | while runnig oe-selftest for gcc, some of the testcases that need to be run on qemu are not running due to below failures: - kex_exchange_identification: read: Connection reset by peer^M Connection reset by 192.168.7.2 port 22^M ERROR: Couldn't create remote directory /tmp/runtest.3549814 on ssh To resolve kex exchange identification error increased the MaxStartups. (From OE-Core rev: 971d63d5b4982ce9ef4c4be742ba83a9708267da) Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit df64d5ab6eb37dcdc2046f449ec539a3f4b985c8) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/postactions: Fix archive retrieval from targetMathieu Dubois-Briand2024-09-201-0/+1
| | | | | | | | | | | | | A previous patch broke archive retrieval because of an undeclared variable. Declare the archive_name variable as expected. (From OE-Core rev: 0d0f3541552b073f3536176e2caf847bec24548d) Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org> CC: Alexis Lothoré <alexis.lothore@bootlin.com> CC: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_qa: fix error handlingLouis Rannou2024-09-171-1/+1
| | | | | | | | | | | | | | | | Make ImageQAFailed inherit BBHandledException so exceptions raised in tests are catched when the actual test function is executed by bb.utils.better_exec. Change the do_image_qa tasks so errors are handled with oe.qa.handle_error. Add some comment to explain this requires to list the test in ERROR_QA or WARN_QA. [YOCTO #14807] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14807 (From OE-Core rev: 905e224849fbbed1719e0add231b00e2d570b3b4) Signed-off-by: Louis Rannou <louis.rannou@non.se.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* spdx30_tasks.py: fix typo in call of is_file methodDaniil Batalov2024-09-131-1/+1
| | | | | | | | | Method is_file() was wrongly called as isfile() (From OE-Core rev: 356c52a45db139bf1fdfcf5b6e0903ece7d1dd46) Signed-off-by: Daniil Batalov <dbatalov@deltard.ru> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust: Rust Oe-Selftest Reduce the testcases in exclude listDeepesh Varatharajan2024-09-121-132/+0
| | | | | | | | | | | | | We had previously excluded certain test cases due to failures in earlier versions. However, with the latest version of Rust, many of these test cases are passing. As a result, we have removed them from the exclude list and added them back into the test suite for execution. The rust-1.79 has been successfully tested with the current test inclusions. (From OE-Core rev: e8dae0ee5ea958bb84af33d9b9a29ab357d96e31) Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Only rewrite envvars paths that absolutely point to builddirYoann Congal2024-09-121-1/+4
| | | | | | | | | | | | | | | | | When building the new selftest builddir, paths in environment variables are rewritten to point to the new buildir, but users can have environment variables that point outside of the build dir using relative paths from builddir. We must not rewrite those. Check this by verifying that the absolute path still contains the builddir. Fixes [YOCTO #15241] (From OE-Core rev: c5e70500caffcd0518899cc6eba23a38bc3be108) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta-ide-support: Mark recipe as MACHINE-specificPaul Barker2024-09-121-2/+2
| | | | | | | | | | | | | | | | meta-ide-support:do_write_test_data dumps the bitbake data dictionary to a file using export2json(). As this obviously includes the value of MACHINE, and other MACHINE-specific variables, the recipe needs to be marked as MACHINE-specific. RP: Note that this patch does change the name of the environment script since it is no longer package arch specific but machine arch specific. [RP: Fix selftest to reference new environment file] (From OE-Core rev: 3be2bc8a9b0c9d6a178329c8b451a6bedf255d6c) Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* conf/defaultsetup.conf: Drop TCLIBCAPPENDRichard Purdie2024-09-051-15/+0
| | | | | | | | | | | | | | We've been able to run musl and glibc builds in the same TMPDIR for many years and a separate directory is not required. Most distros disable this value for that reason. Drop support for the variable to make it clear and easy for distros to be able to set multiconfigs which behave consistently for distros which do and don't clear it by dropping it entirely. (From OE-Core rev: ebcd355a32e2711263e22d9b45b502696ecbb4d2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/sbom30.py: Fix build parametersJoshua Watt2024-09-041-1/+1
| | | | | | | | | | The property to specify the build parameters is `build_parameters` not just `parameters` (From OE-Core rev: 61afc6322c9b8664de4f32b629c6e6ade775aeba) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/spdx30_tasks: Report all missing providersJoshua Watt2024-09-041-1/+8
| | | | | | | | | | | Instead of failing on the first missing provider, collect all of them and report them all as it is more convenient for end users trying to fix problems (From OE-Core rev: fc96244f424c8b4fbace39dc4af8a4e97f1a104e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_non_auh_upgrade: improve parse logic5.1_M3Trevor Gamblin2024-09-011-2/+2
| | | | | | | | | | | | | | | | The AUH email address used for matching was outdated. Fix it so that it correctly identifies emails using the new one. Also make sure to only scan the commit message and not the body, since it's possible (like in this patch) that the user may be editing actual code that checks for AUH-related strings. Fixes [YOCTO #15390]. (From OE-Core rev: 557400648b6f4f31176847f8a068d2e199b7793d) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_shortlog_length: omit shortlog prefixesTrevor Gamblin2024-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | In certain cases, the shortlog for a patch would include branch and 'PATCH' tag information even after the repo tag got stripped out, padding it with data that wouldn't actually be included with a merge. This caused the patchtest test_shortlog_length test to erroneously report a failure. For example, a patch whose shortlog tags were: [OE-core][master/scarthgap][PATCH] would leave this behind in the shortlog, along with the actual content: [master/scarthgap][PATCH] Add a re.sub() call in the test to fix this by removing all square bracket pairs that appear at the beginning of the string. Fixes [YOCTO #15575]. (From OE-Core rev: 6e1ddadfe779291cf46fb88fb01769c022b733ac) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: test_mbox: remove duplicate regex definitionTrevor Gamblin2024-09-011-1/+0
| | | | | | | | (From OE-Core rev: b350239ce1350ed61410431d30e938365d406db1) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testexport: support for executing tests over serialAndrew Oppelt2024-09-012-1/+326
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses TEST_SERIALCONTROL_CMD to open a serial connection to the target and execute commands. This is a drop in replacement for the ssh target, fully supporting the same API. Supported with testexport. To use, set the following in local.conf: - TEST_TARGET to "serial" - TEST_SERIALCONTROL_CMD to a shell command or script which connects to the serial console of the target and forwards that connection to standard input/output. - TEST_SERIALCONTROL_EXTRA_ARGS (optional) any parameters that must be passed to the serial control command. - TEST_SERIALCONTROL_PS1 (optional) A regex string representing an empty prompt on the target terminal. Example: "root@target:.*# ". This is used to find an empty shell after each command is run. This field is optional and will default to "root@{MACHINE}:.*# " if no other value is given. - TEST_SERIALCONTROL_CONNECT_TIMEOUT (optional) Specifies the timeout in seconds for the initial connection to the target. Defaults to 10 if no other value is given. The serial target does have some additional limitations over the ssh target. 1. Only supports one "run" command at a time. If two threads attempt to call "run", one will block until it finishes. This is a limitation of the serial link, since two connections cannot be opened at once. 2. For file transfer, the target needs a shell and the base32 program. The file transfer implementation was chosen to be as generic as possible, so it could support as many targets as possible. 3. Transferring files is significantly slower. On a 115200 baud serial connection, the fastest observed speed was 30kbps. This is due to overhead in the implementation due to decisions documented in #2 above. (From OE-Core rev: d817b27d73d29ba2beffa2e0a4e31a14dbe0f1bf) Signed-off-by: Andrew Oppelt <andrew.j.oppelt@boeing.com> Signed-off-by: Matthew Weber <matthew.l.weber3@boeing.com> Signed-off-by: Chuck Wolber <chuck.wolber@boeing.com> -- Tested with core-image-sato on real hardware. TEST_SERIALCONTROL_CMD was set to a bash script which connected with telnet to the target. Additionally tested with QEMU by setting TEST_SERIALCONTROL_CMD to "ssh -o StrictHostKeyChecking=no root@192.168.7.2". This imitates a serial connection to the QEMU instance. Steps: 1) Set the following in local.conf: - IMAGE_CLASSES += "testexport" - TEST_TARGET = "serial" - TEST_SERIALCONTROL_CMD="ssh -o StrictHostKeyChecking=no root@192.168.7.2" 2) Build an image - bitbake core-image-sato 3) Run the test export - bitbake -c testexport core-image-sato 4) Run the image in qemu - runqemu nographic core-image-sato 5) Navigate to the test export directory 6) Run the exported tests with target-type set to serial - ./oe-test runtime --test-data-file ./data/testdata.json --packages-manifest ./data/manifest --debug --target-type serial Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildcfg.py: add dirty status to get_metadata_git_describeJörg Sommer2024-09-011-1/+1
| | | | | | | | | | For postmortem analysis it's helpful to know if the build environment was clean or contained any modifications. (From OE-Core rev: edaaa2ad311663beabd2416037de00d82fca5fba) Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/bbclasses: Add tests for systemd and update-rc.d interactionPeter Kjellerstedt2024-09-011-0/+106
| | | | | | | | | | | These tests verify that the correct files are left behind when systemd is inherited and depending on whether the systemd and/or sysvinit distro features are enabled. (From OE-Core rev: 4ef25caa00ad08046567d0e7f4523486c3a256d0) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust: Oe-selftest changes for rust v1.79Yash Shinde2024-08-291-88/+82
| | | | | | | | | | | | | | | | | | | | | | | | * Sort the exclude list in alphabetical order. * Add some of the upsupported/failing tests to the exclude list and ignore the failing unit tests. * Remove duplicated tests from the exclude list. * Testing summary Target PASS SKIPPED ARM 17241 599 ARM64 17279 561 MIPS64 17228 612 PPC 17194 629 X86 17257 583 X86-64 17416 424 (From OE-Core rev: 61ec0f0f78d9db4c3fc02365713d5fd77b78a7ea) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/sstatetests: Extend to cover ERROR_QA/WARN_QA common issuesRichard Purdie2024-08-291-0/+2
| | | | | | | | | Now that adding new values to ERROR_QA doesn't invalidate tasks, add this check to the selftests so that this functionality doens't regress in future. (From OE-Core rev: 823b5f6cf64ad37ee68e6274c58823f7cc75ddf0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Drop oe.qa.add_message usageRichard Purdie2024-08-291-6/+0
| | | | | | | | | | | | | | | Drop the oe.qa.add_message() usage in favour of oe.qa.handle_error() which has code allowing it to be optimised with contains usage. The patch also drops unused return values which we stopped using a while ago and drops the now unneeded function parameters, generally leading to cleaner code. The code should be functionally equivalent. (From OE-Core rev: 9b2eea9fd4eab4f5e12e955738db22091b91f698) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe: Use new visitorcode functionality for qa.handle_error()Richard Purdie2024-08-292-2/+20
| | | | | | | | | | | | | | | | | | | | Early functions like do_recipe_qa (which do_fetch depends upon) reference oe.qa.handle_error() which in turn adds dependencies on ERROR_QA and WARN_QA. This means that ERROR_QA:append = " nothing" will cause literally everything to rebuild and break sstate reuse. Take advantage of new bitbake functionality to add a custom visitorcode function to handle_error which optimises the references into contains expressions which means the ERROR_QA and WARN_QA references are optmised to containing specific strings. This dramatically improves sstate reuse. The qa module has to be imported first since other code in later modules references it and bitbake can't handle the dependency ordering internally without a lot of unwanted complexity. (From OE-Core rev: a911ea9659503e9442a183f366e4545a5efe246e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* hicolor-icon-theme: upgrade 0.17 -> 0.18Alexander Kanavin2024-08-281-2/+2
| | | | | | | (From OE-Core rev: 7ca759f98a46d9fcf485edc3eeff4e9cf73a4669) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: use INIT_MANAGER to enable systemd instead of custom settingsAlexander Kanavin2024-08-282-10/+2
| | | | | | | | | | | | This is already done in most of selftest; these two were the last holdouts I could fine. Hopefully this improves sstate reuse as well. (From OE-Core rev: 98f2feeea8f54f899e831a13191578b94cde7670) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: always tweak ERROR_QA/WARN_QA per packageAlexander Kanavin2024-08-282-6/+6
| | | | | | | | | | Globally changing it completely destroys sstate reuse, as seen for example here: https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/3763/steps/14/logs/stdio (From OE-Core rev: 9c75c11f4f6816cfc56eb85a43859a228a5d2950) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/sstatesig.py: do not error out if sstate files fail on os.stat()Alexander Kanavin2024-08-251-4/+16
| | | | | | | | | | | | | | | There's an ongoing issue with the autobuilder NFS: https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6463/steps/14/logs/stdio The file entry exists, but os.stat returns a 'file not found; error. It's not clear how and why such entries appear, but they do produce printdiff test failures and should not be relevant in context of the printdiff. [RP: Move wrapping to get_time() function to cover all cases and add comment] (From OE-Core rev: b7e702752b6a2dfc8493639a8529cf1a16793f03) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: split guess_license functionEnguerrand de Ribaucourt2024-08-231-0/+1
| | | | | | | | | | | | | | | The npm recipetool handler redefines the license code the could be unified. In order to do this refactoring, extract the bits we'll need into separate functions. guess_license() is renamed to find_licenses() and is split into find_license_files() and match_licenses(). (From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2) Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kmod: upgrade 32 -> 33Alexander Kanavin2024-08-231-4/+4
| | | | | | | | | | | | | Disable manpages, as they require scdoc, which is not currently available in core (and adjust a related selftest). Drop 0001-Use-portable-implementation-for-basename-API.patch as upstream fixed the issue differently. (From OE-Core rev: f868b75ab22cd528d9add744042f13d475715ef4) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/ssh: increase the number of attemptsJon Mason2024-08-221-1/+1
| | | | | | | | | | | Under high load, the ssh test is hitting the amount of retries. Increase it to 20 to avoid this issue. This would increase the maximum failure time from 50 seconds (5 * 10) to 100 seconds. (From OE-Core rev: c796438eec5dd6b4671b798f85506bc89ff402ab) Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* license_image.bbclass: Rename license-incompatible to license-exceptionPeter Kjellerstedt2024-08-211-1/+1
| | | | | | | | | | | | | | | | There is currently both an incompatible-license and a license-incompatible QA message. This is very confusing. However, license-incompatible is only used to output a message when a package is included in an image despite it having a license that is normally incompatible (by using the INCOMPATIBLE_LICENSE_EXCEPTIONS variable). To better match how it is used and to distinguish it from incompatible-license, rename it to license-exception. (From OE-Core rev: d309eed66f5a4a4bce082536e51207fe65725fab) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: add test_product_matchMarta Rybczynska2024-08-201-0/+48
| | | | | | | | | CVECheck.test_product_match tests has_cve_product_match() (From OE-Core rev: 30ee6edc57ff7629a72606d1005f92d43a5d14f9) Signed-off-by: Marta Rybczynska <marta.rybczynska@syslinbit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve_check: Update selftest with new status detailSamantha Jalabert2024-08-201-1/+2
| | | | | | | | (From OE-Core rev: ea7681ffc15cac970c395daab56ba264ac406cd6) Signed-off-by: Samantha Jalabert <samantha.jalabert@syslinbit.com> Signed-off-by: Marta Rybczynska <marta.rybczynska@syslinbit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: annotate CVEs during analysisMarta Rybczynska2024-08-201-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add status information for each CVE under analysis. Previously the information passed between different function of the cve-check class included only tables of patched, unpatched, ignored vulnerabilities and the general status of the recipe. The VEX work requires more information, and we need to pass them between different functions, so that it can be enriched as the analysis progresses. Instead of multiple tables, use a single one with annotations for each CVE encountered. For example, a patched CVE will have: {"abbrev-status": "Patched", "status": "version-not-in-range"} abbrev-status contains the general status (Patched, Unpatched, Ignored and Unknown that will be added in the VEX code) status contains more detailed information that can come from CVE_STATUS and the analysis. Additional fields of the annotation include for example the name of the patch file fixing a given CVE. We also use the annotation in CVE_STATUS to filter out entries that do not apply to the given recipe (From OE-Core rev: 452e605b55ad61c08f4af7089a5a9c576ca28f7d) Signed-off-by: Marta Rybczynska <marta.rybczynska@syslinbit.com> Signed-off-by: Samantha Jalabert <samantha.jalabert@syslinbit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: encode affected product/vendor in CVE_STATUSMarta Rybczynska2024-08-202-14/+36
| | | | | | | | | | | | | | | | | | CVE_STATUS contains assesment of a given CVE, but until now it didn't have include the affected vendor/product. In the case of a global system include, that CVE_STATUS was visible in all recipes. This patch allows encoding of affected product/vendor to each CVE_STATUS assessment, also for groups. We can then filter them later and use only CVEs that correspond to the recipe. This is going to be used in meta/conf/distro/include/cve-extra-exclusions.inc and similar places. (From OE-Core rev: abca80a716e92fc18d3085aba1a15f4bac72379c) Signed-off-by: Marta Rybczynska <marta.rybczynska@syslinbit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust: Oe-selftest changes for rust v1.78Yash Shinde2024-08-201-1/+33
| | | | | | | | | | Add some of the upsupported/failing tests to the exclude list and ignore the failing unit tests. (From OE-Core rev: 81bbd6db47f45628ff4be400e1f2fa5b09ccd0bb) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/postactions: do not uncompress retrieved archive on hostAlexis Lothoré2024-08-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Current postaction module executes a remote tar command, pipe it in a SSH connection, and uncompress the raw stream with another tar command. With this command, the whole artifacts tree is directly available on the host executing the test, but it is not very convenient if we want to download the whole retrieved ptests directory. Stop uncompressing the retrieved ptests archive onto host, just save the archive as it is. The new output then looks like the following: tmp/log/oeqa-artefacts └── oeqa-target-artefacts-20240812-juzqdb80 ├── host_disk_usage.txt ├── target_disk_usage.txt └── tests_artifacts.tar.gz Suggested-By: Alexandre Belloni <alexandre.belloni@bootlin.com> (From OE-Core rev: f90894d996c8a8f980e46c87b7968b176793b3fe) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/postactions: fix exception handlingAlexis Lothoré2024-08-131-1/+1
| | | | | | | | | | | | | | | The current exception handler in list_and_fetch_failed_tests_artifacts expects a non-exisiting variable and then fail to display the original exception message since it raises a new one. The issue has been introduced with commit 6e80b2ab660e ("oeqa/utils/postactions: transfer whole archive over ssh instead of doing individual copies"). Now that tests artifacts are now handled individually, there's no point of trying to print individual names in the exception. (From OE-Core rev: a50e72bb64fb8b0d14c23164eaeeabd9c271ac19) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/gcc: Fix host key verfication failureHarish Sadineni2024-08-131-1/+1
| | | | | | | | | | | | | | | | | | while runnig oe-selftest for gcc, testcases that need to be run on qemu are not running due to below failures. - Executing on ssh: mkdir -p /tmp/runtest.3549641 (timeout = 300) spawn [open ...] Host key verification failed. ERROR: Couldn't create remote directory /tmp/runtest.3549641 on ssh Host key verification failure is happening when ssh board config file name is defined as "ssh.exp" and there are multiple ssh.exp files generated during the build and a wrong ssh config was taken. To resolve this changed the board config file name to "linux-ssh.exp" which ensures correct ssh settings are used. (From OE-Core rev: d32ec0b4d242879ab8eaf96e1cb407e8f0bb9f3d) Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>