summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* reproducible: Fix race with externalsrc/devtool over lockfileRichard Purdie2024-02-221-0/+3
| | | | | | | | | | | | | | | We occasionally see races over the lockfile used by externalsrc/devtool when walking files for the source_date_epock calculation. Skip this file if present to avoid the issues and fix a real issue where SDE could be contaminated too. [YOCTO #14921] (From OE-Core rev: 6bb824019fd7335a10fdcebf7d301c101d60ad61) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4bc0eb4bd90e6e6e46581a8ed367212bdd910a26) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* cve_check: cleanup loggingRoss Burton2024-02-221-7/+6
| | | | | | | | | | | | | | Primarily list the number of patches found, useful when debugging. Also clean up some bad escaping that caused warnings and use re.IGNORECASE instead of manually doing case-insenstive rang matches. (From OE-Core rev: 55d7393eda71fa37a93c1a0f5c8f7f18640cf079) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 10acc75b7f3387b968bacd51aade6a8dc11a463f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* cve_check: handle CVE_STATUS being set to the empty stringRoss Burton2024-02-221-2/+2
| | | | | | | | | | | | | | | Handle CVE_STATUS[...] being set to an empty string just as if it was not set at all. This is needed for evaluated CVE_STATUS values to work, i.e. when setting not-applicable-config if a PACKAGECONFIG is disabled. (From OE-Core rev: a8ccf2abdc89cf4ae3dce1fed4163e3c1399e528) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2c9f20f746251505d9d09262600199ffa87731a2) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* rootfs.py: check depmodwrapper execution resultYang Xu2024-02-071-1/+2
| | | | | | | | | | | | | | The execution result of depmodwrapper is not checked which makes depmod generation failed sliently and hard to detect. So check exection result and stop building if depmodwrapper failed. (From OE-Core rev: 2d8e913e2bfbb4ccbdf3eb747aab46fc38cf23e7) Signed-off-by: Yang Xu <yang.xu@mediatek.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 2f88e7d331390c6aaecc4522253e24791aec299e) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* package.py: OEHasPackage: Add MLPREFIX to packagenameSaul Wold2024-01-311-2/+3
| | | | | | | | | | | | | | | | | FIXES [YOCTO #12342] When testing a Multilib image, the package manifest list contains the fully qualified package name which includes the Multilib Prefix. This patch adds the MLPREFIX to the package names that are passed into the @OEHasPackage() decorator to ensure the set isdisjoint() matches correctly. (From OE-Core rev: a27983e0b6bde730fe501c9931119bf18b2c376b) Signed-off-by: Saul Wold <sgw@bigsur.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit ab87e4f92305b2a664cc473869e1615cf56e0936) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/selftest/prservice: Improve test robustnessRichard Purdie2024-01-311-8/+23
| | | | | | | | | | | | | | The tests were not cleaning up after themselves and making assumptions about memory resident bitbake being stopped by the scripts. Add cleanup logic to ensure the tests don't break other things and clean up created files. (From OE-Core rev: 81d7011a793de2548c573ebb84f60fb80a357bed) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 692dd762a0c817797c28381c6169205fbaeb2705) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* lib/prservice: Improve lock handling robustnessRichard Purdie2024-01-311-3/+1
| | | | | | | | | | | | | | It is possible we could crash holding a lock whilst parsing in this code. Switch to use utils.fileslocked() in the with expression to avoid this. This may be causing some of our strange intermittent failures in PRServ tests. (From OE-Core rev: 4e3c9526c2389fd08d86d986014313e1d404f1fb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4e59db15e5df2cc3d0ae042454812a2d54cef77b) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* testimage: Drop target_dumper and most of monitor_dumperRichard Purdie2024-01-043-31/+1
| | | | | | | | | | | | | | | | | | The target_dumper code is basically broken. It has been reading binary files over the text base serial communication and runs at every command failure which makes no sense. Each run might overwrite files from the previous run and the output appears corrupted due to confusion from the binary data. For now, remove the commands and the target dumper code as the command and execution point are problematic. Also remove the same pieces of the monitor code but leave the command list since in theory this can be moved to a more useful place in the code. (From OE-Core rev: 4c7aa982a996b23a4c5100c5a5a9390e26e5fe46) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a24d787987dccc95fdd95b7e85bf525a1c55b285) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: shorten patch signed-off-by test outputTrevor Gamblin2024-01-041-1/+2
| | | | | | | | | | | | | | | | | The patch Signed-off-by test's output line is excessively long, and can trigger a failsafe in the patchtest automated service's email content generation. Shorten the output by reducing redundant phrasing and using os.path.basename to get only the failing patch's name, not the entire path, as the submitter should have a good idea of where it is located regardless. (From OE-Core rev: f6a6af896dd1968eded614b0c519dc375eff407a) 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> (cherry picked from commit cc7546ded87dd44a988d7a23f1d7645094b5cdd4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* lib/oe/patch: ensure os.chdir restoring always happensRoss Burton2024-01-041-3/+4
| | | | | | | | | | | | If we chdir(), do the chdir back to the original directory in a finally block so they always run. (From OE-Core rev: 1680d1766445b21e35c6b874c4767b385862017f) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cdc40292818683b6df1c814498c7589450a163fa) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* sstate: Ensure sstate searches update file mtimeRichard Purdie2023-12-151-0/+12
| | | | | | | | | | | | | | | | | Commands like "bitbake XXX -S printdiff" search for sstate files but don't download them. This means that local files aren't touched as the download code would do, meaning the sstate cleanup scripts can delete them. This can then lead to obtuse build failures. Have the search code touch local files in the same way as the main code paths would to avoid these files disappearing. Move the function to a common touch() function in lib/oe instead of duplicating code. (From OE-Core rev: 427c43d8e3315fa6872feaa71d135de60c810de7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a27fc0bd5706ab5b9c68a0271fcf57377a678cdf) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/selftest/tinfoil: Add tests that parse virtual recipesPeter Kjellerstedt2023-12-151-1/+24
| | | | | | | | | | | | | | | | | | Running `devtool search gcc` would result in errors for virtual recipes. The reason was the newly introduced :layer-<layername> override. When tinfoil parsed the recipes using the parseRecipeFile() function, it failed to properly identify the layername for virtual recipes, which resulted in the errors. Add tests that exercise these code paths through parseRecipeFile(). (From OE-Core rev: f415c97ad538ce046c87af3fc9eeec6599313764) 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> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* lib/oe/path: Deploy files can start only with a dotVyacheslav Yurkov2023-12-051-1/+2
| | | | | | | | | | | | | | | | | There might be only hidden files deployed. In that case we don't need a generic wildcard present in copy command, otherwise it fails with: Exception: subprocess.CalledProcessError: Command 'cp -afl --preserve=xattr ./.??* ./* <BUILDDIR>/tmp/deploy/images/qemux86-64' returned non-zero exit status 1. Subprocess output: cp: cannot stat './*': No such file or directory (From OE-Core rev: c45f3e00189e034157996b88103a83efec3e0cf6) Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@wika.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit f92c751281609ea6bd6b838307de4bc70bf26ab9) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* lib/oe/buildcfg.py: Remove unused parameterJermain Horsman2023-12-051-5/+5
| | | | | | | | | | | | Several functions included the 'd' parameter but never used it, additionally the value passed is always None. (From OE-Core rev: ea871e7920726c7b2e57161092e21c62e6a5d91e) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 9e03ce0426576ebef3739dc1dfec4f7cd73ae094) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* lib/oe/buildcfg.py: Include missing importJermain Horsman2023-12-051-0/+1
| | | | | | | | | | | | get_layer_revisions() uses the os.path module but it is not included in the imports. (From OE-Core rev: a888d56d46b01d6126179e3f38e3c1739c38d45c) Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 4339ef5b46c39cce402d1cc3526b39702837b839) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/selftest/debuginfod: improve selftestRoss Burton2023-11-241-36/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was occasionally failing for no obvious reason, so refactor and improve: - While waiting for the daemon, check that it is still running and explicitly timeout after 10s when making the HTTP call. - While waiting for the daemon to be ready, log the current state of the daemon so we can tell if we're timing out as it is still scanning. - This was in fact the cause of the intermittant failures, because the TMPDIR is reused between tests and may contain a large number of packages. Do the tests in an isolated TMPDIR to hopefully mitigate this issue and increase the timeout to two minutes. - Decorate the test using runqemu as such so that can be skipped in environments without runqemu - Add a second test that doesn't use runqemu or images, which is faster but less realistic. (From OE-Core rev: 99590fac1bfb5474f5bf0e02d3888b518af9fb3e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 88b660aaae2527736b6eccec4c952eee969e20a2) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: rework license checksum testsTrevor Gamblin2023-11-241-32/+8
| | | | | | | | | | | | | | | Remove the pretest_lic_files_chksum_modified_not_mentioned test entirely and use pyparsing in test_lic_files_chksum_modified_not_mentioned to scan the patches for lines starting with either "+LIC_FILES_CHKSUM" or "-LIC_FILES_CHKSUM". If either is found but no "License-Update" tag is present in the commit, fail the test. (From OE-Core rev: d1871afcec769b6503852adf6217460897ecf301) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 8e1bda0eb225ada22fdf5990edfec512be1d6629) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: remove test for CVE tag in mboxTrevor Gamblin2023-11-243-170/+0
| | | | | | | | | | | | | | | After patchtest went live it was determined that testing for a CVE tag in the mbox commit message is unnecessary, since it will already be in the shortlog and in any carried patches. Remove the test and the associated selftest files so that its absence isn't flagged in future test results. (From OE-Core rev: bf9671896eb60880b5dad36c2706855932ce091f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 54690f18f04a2ab993a85d551ce4f8d0fa56618a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: make pylint tests compatible with 3.xTrevor Gamblin2023-11-241-5/+12
| | | | | | | | | | | | | pylint 3.x has removed epylint, which is now a separate module. To avoid adding another recipe or using outdated modules, modify the test_python_pylint tests so that they use the standard pylint API. (From OE-Core rev: 8b3c6837fe2367fa7aa20b2ee5be554be98f2acd) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 72be3d6a116febf46130cccbe12afe5ad93779b5) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: shorten test result outputsTrevor Gamblin2023-11-242-9/+9
| | | | | | | | | | | | | | Some test result lines in TestMbox and TestPatch are still too long to avoid being flagged by the mailer script. Clean them up by removing redundant information, so that they are all under the length limit of 220 characters. (From OE-Core rev: c543469e2da32a474a60a497b5d51fd9fc43dbb4) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c10d0bb542b23fbdc14d76dfa8e5885aa4d33083) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: reduce checksum test output lengthTrevor Gamblin2023-11-241-1/+1
| | | | | | | | | | | | | | | The test_lic_files_chksum_modified_not_mentioned test in TestMetadata is outputting very long lines that fail the maximum length check when sending email results, preventing the actual errors from being displayed. Reduce the length of the failure message by rewording and removing redundant information. (From OE-Core rev: e3c680bab99f7e5f0cb7874ada0297b5fac66702) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2e2625735181160e9760a6f3af4955bda2ea6d4d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: simplify test directory structureTrevor Gamblin2023-11-2453-603/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate the various mbox tests into a new TestMbox class, metadata tests into TestMetadata, and patch tests into TestPatch. Also update the selftest filenames to match the changes. The test contents are not significantly changed (other than to reference the new class names). While this doesn't improve overall readability, it does result in more obvious categorization, and more importantly reduces the number of calls to setup tinfoil in the tests, resulting in a roughly 25% reduction in runtime. Before: [tgamblin@megalith poky]$ time ./meta/lib/patchtest/selftest/selftest XPASS: PatchSignedOffBy.test_signed_off_by_presence (file: PatchSignedOffBy.test_signed_off_by_presence.pass) XFAIL: Shortlog.test_shortlog_format (file: Shortlog.test_shortlog_format.fail) XFAIL: MboxFormat.test_mbox_format (file: MboxFormat.test_mbox_format.1.fail) XPASS: Shortlog.test_shortlog_length (file: Shortlog.test_shortlog_length.pass) XFAIL: CommitMessage.test_commit_message_presence (file: CommitMessage.test_commit_message_presence.fail) XFAIL: SrcUri.test_src_uri_left_files (file: SrcUri.test_src_uri_left_files.fail) XPASS: Author.test_author_valid (file: Author.test_author_valid.1.pass) XFAIL: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned (file: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned.fail) XPASS: CVE.test_cve_tag_format (file: CVE.test_cve_tag_format.pass) XPASS: CVE.test_cve_presence_in_commit_message (file: CVE.test_cve_presence_in_commit_message.pass) XFAIL: CVE.test_cve_tag_format (file: CVE.test_cve_tag_format.fail) XFAIL: Author.test_author_valid (file: Author.test_author_valid.1.fail) XFAIL: LicFilesChkSum.test_lic_files_chksum_presence (file: LicFilesChkSum.test_lic_files_chksum_presence.fail) XSKIP: Merge.test_series_merge_on_head (file: Merge.test_series_merge_on_head.2.skip) XPASS: MboxFormat.test_mbox_format (file: MboxFormat.test_mbox_format.pass) XFAIL: SignedOffBy.test_signed_off_by_presence (file: SignedOffBy.test_signed_off_by_presence.1.fail) XPASS: Shortlog.test_shortlog_format (file: Shortlog.test_shortlog_format.pass) XFAIL: SignedOffBy.test_signed_off_by_presence (file: SignedOffBy.test_signed_off_by_presence.2.fail) XFAIL: MboxFormat.test_mbox_format (file: MboxFormat.test_mbox_format.2.fail) XFAIL: Summary.test_summary_presence (file: Summary.test_summary_presence.fail) XPASS: Author.test_author_valid (file: Author.test_author_valid.2.pass) XSKIP: Merge.test_series_merge_on_head (file: Merge.test_series_merge_on_head.1.skip) XPASS: Bugzilla.test_bugzilla_entry_format (file: Bugzilla.test_bugzilla_entry_format.pass) XFAIL: CVE.test_cve_presence_in_commit_message (file: CVE.test_cve_presence_in_commit_message.fail) XPASS: SignedOffBy.test_signed_off_by_presence (file: SignedOffBy.test_signed_off_by_presence.pass) XPASS: LicFilesChkSum.test_lic_files_chksum_presence (file: LicFilesChkSum.test_lic_files_chksum_presence.pass) XPASS: CommitMessage.test_commit_message_presence (file: CommitMessage.test_commit_message_presence.pass) XPASS: Summary.test_summary_presence (file: Summary.test_summary_presence.pass) XPASS: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned (file: LicFilesChkSum.test_lic_files_chksum_modified_not_mentioned.pass) XFAIL: Shortlog.test_shortlog_length (file: Shortlog.test_shortlog_length.fail) XFAIL: PatchSignedOffBy.test_signed_off_by_presence (file: PatchSignedOffBy.test_signed_off_by_presence.fail) XFAIL: Bugzilla.test_bugzilla_entry_format (file: Bugzilla.test_bugzilla_entry_format.fail) XPASS: SrcUri.test_src_uri_left_files (file: SrcUri.test_src_uri_left_files.pass) XFAIL: Author.test_author_valid (file: Author.test_author_valid.2.fail) ============================================================================ Testsuite summary for patchtest ============================================================================ ============================================================================ real 24m14.386s user 1m13.599s sys 0m21.477s After: [tgamblin@megalith poky]$ time ./meta/lib/patchtest/selftest/selftest XFAIL: TestMbox.test_bugzilla_entry_format (file: TestMbox.test_bugzilla_entry_format.fail) XPASS: TestMetadata.test_summary_presence (file: TestMetadata.test_summary_presence.pass) XFAIL: TestMbox.test_mbox_format (file: TestMbox.test_mbox_format.1.fail) XFAIL: TestMetadata.test_src_uri_left_files (file: TestMetadata.test_src_uri_left_files.fail) XSKIP: TestMbox.test_series_merge_on_head (file: TestMbox.test_series_merge_on_head.2.skip) XPASS: TestMbox.test_commit_message_presence (file: TestMbox.test_commit_message_presence.pass) XFAIL: TestMbox.test_commit_message_presence (file: TestMbox.test_commit_message_presence.fail) XPASS: TestMbox.test_signed_off_by_presence (file: TestMbox.test_signed_off_by_presence.pass) XFAIL: TestPatch.test_cve_tag_format (file: TestPatch.test_cve_tag_format.fail) XFAIL: TestMbox.test_author_valid (file: TestMbox.test_author_valid.1.fail) XFAIL: TestMbox.test_shortlog_length (file: TestMbox.test_shortlog_length.fail) XPASS: TestMbox.test_mbox_format (file: TestMbox.test_mbox_format.pass) XFAIL: TestPatch.test_signed_off_by_presence (file: TestPatch.test_signed_off_by_presence.fail) XFAIL: TestMbox.test_shortlog_format (file: TestMbox.test_shortlog_format.fail) XFAIL: TestMbox.test_mbox_format (file: TestMbox.test_mbox_format.2.fail) XPASS: TestPatch.test_cve_tag_format (file: TestPatch.test_cve_tag_format.pass) XSKIP: TestMbox.test_series_merge_on_head (file: TestMbox.test_series_merge_on_head.1.skip) XPASS: TestMbox.test_author_valid (file: TestMbox.test_author_valid.2.pass) XPASS: TestMetadata.test_lic_files_chksum_modified_not_mentioned (file: TestMetadata.test_lic_files_chksum_modified_not_mentioned.pass) XPASS: TestMbox.test_bugzilla_entry_format (file: TestMbox.test_bugzilla_entry_format.pass) XPASS: TestMetadata.test_src_uri_left_files (file: TestMetadata.test_src_uri_left_files.pass) XPASS: TestMetadata.test_lic_files_chksum_presence (file: TestMetadata.test_lic_files_chksum_presence.pass) XPASS: TestMbox.test_cve_presence_in_commit_message (file: TestMbox.test_cve_presence_in_commit_message.pass) XFAIL: TestMbox.test_signed_off_by_presence (file: TestMbox.test_signed_off_by_presence.2.fail) XFAIL: TestMbox.test_author_valid (file: TestMbox.test_author_valid.2.fail) XFAIL: TestMetadata.test_lic_files_chksum_presence (file: TestMetadata.test_lic_files_chksum_presence.fail) XPASS: TestMbox.test_shortlog_format (file: TestMbox.test_shortlog_format.pass) XPASS: TestMbox.test_author_valid (file: TestMbox.test_author_valid.1.pass) XPASS: TestPatch.test_signed_off_by_presence (file: TestPatch.test_signed_off_by_presence.pass) XFAIL: TestMetadata.test_lic_files_chksum_modified_not_mentioned (file: TestMetadata.test_lic_files_chksum_modified_not_mentioned.fail) XPASS: TestMbox.test_shortlog_length (file: TestMbox.test_shortlog_length.pass) XFAIL: TestMbox.test_signed_off_by_presence (file: TestMbox.test_signed_off_by_presence.1.fail) XFAIL: TestMbox.test_cve_presence_in_commit_message (file: TestMbox.test_cve_presence_in_commit_message.fail) XFAIL: TestMetadata.test_summary_presence (file: TestMetadata.test_summary_presence.fail) ============================================================================ Testsuite summary for patchtest ============================================================================ ============================================================================ real 18m39.749s user 0m41.857s sys 0m14.708s (From OE-Core rev: 497e128546b37d6cf5fb86188fff4c7a22526ec8) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f788592da2fd0e21638ce2c3326675a060ba51cf) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest/selftest: add XSKIP, update test filesTrevor Gamblin2023-11-243-3/+8
| | | | | | | | | | | | | | Since we are skipping the merge test, two of the selftests now report SKIP instead of XPASS/XFAIL as expected. Adjust the two files to have the right endings for XSKIP, and add the category so that it can be used for more extensive testing in the future. (From OE-Core rev: a354265065516ec634042ea8210f97aaba7ff43c) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3331f53c0be2575784a042bb2401eeba4f2a5a3e) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: disable merge testTrevor Gamblin2023-11-241-0/+1
| | | | | | | | | | | | | Disable the merge-on-head test until patchtest properly handles merging of series subsets and accounts for patches that are rapidly merged (i.e. before patchtest is run). (From OE-Core rev: 97c1d8aa7318e36a037aa6c8b721fb75608a92a7) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e561c614dc72b7f8bf5e09a09bbe6ebc3cf500bb) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: fix lic_files_chksum test regexTrevor Gamblin2023-11-241-3/+2
| | | | | | | | | | | | | the test_lic_files_chksum_modified_not_mentioned test in patchtest wasn't picking up on 'License-Update:' tags correctly. Use pyparsing's AtLineStart class to simplify the regex setup and search. (From OE-Core rev: 978c819c33c0552750f5383f0ed761d505b4bdf5) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dc9126e45e74b915faaf296037e7ece41785bf4a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: skip merge test if not targeting masterTrevor Gamblin2023-11-241-0/+2
| | | | | | | | | | | | | Avoid testing mergeability of a patch when not targeting master, so that patches tested via other means (e.g. maintainer branches and AB runs) don't get unnecessarily reviewed an extra time. (From OE-Core rev: 127fa20bd1d628548f7f4ba087b3ca105e705098) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e6cf23e353f48c57249681bd0b12bd8494d4959a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: test regardless of mergeabilityTrevor Gamblin2023-11-244-17/+0
| | | | | | | | | (From OE-Core rev: 06d2066a5061d23a316f65cfc731ce44b576b2bf) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dc089073eb120de76c8907e476c341ed3e97c164) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* patchtest: remove unused importsRoss Burton2023-11-248-8/+0
| | | | | | | | | (From OE-Core rev: 673d1b51b5183a81d1daaa7a48250aa938679883) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit be8429d986335aae65c2426862b97836ba46e42a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/selftest/devtool: abort if a local workspace already existJulien Stephan2023-11-241-0/+3
| | | | | | | | | | | | | | | | | | | | | if user run devtool selftests with a local workspacelayer the tests fail with various error such as: - devtool.DevtoolAddTests.test_devtool_add just hangs - devtool.DevtoolModifyTests.* fail with the following error: ERROR: Found duplicated BBFILE_COLLECTIONS 'workspacelayer', check bblayers.conf or layer.conf to fix it. Found duplicated BBFILE_COLLECTIONS 'workspacelayer', check bblayers.conf or layer.conf to fix it. Check if a workspacelayer exists, warn the user and abort the tests (From OE-Core rev: b8756f6e20d15f1cc724784d8ceb45a969ec7f81) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a74962cfb0485f6f2b9e2b751c33c8eafca8705a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oeqa/ssh: Handle SSHCall timeout error codeluca fancellu2023-11-242-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code in ssh.py is terminating the ssh process that does not finish its computation in a given timeout (when timeout is passed), the SSHCall function is returning the process error code. The Openssl ssh before version 8.6_p1 is returning 0 when it is terminated, from commit 8a9520836e71830f4fccca066dba73fea3d16bda onwards (version >= 8.6_p1) ssh is returning 255 instead. So for version of ssh older than 8.6_p1 when the SSHCall time out, the return code will be 0, meaning success, which is wrong. Fix this issue checking if the process has timeout (hence it's been terminated) and checking if the returned code is 0, in that case set it to 255 to advertise that an error occurred. Add a test case excercising the timeout in the SSHTest, test_ssh test function. (From OE-Core rev: 82215c855ee39b4e39f24113241a7fb3f20f9531) Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 948fecca1db4c7a30fcca5fcf5eef95cd12efb00) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* goarch: Move Go architecture mapping to a libraryJoshua Watt2023-11-242-1/+35
| | | | | | | | | | | | | | Other spaces uses the Go architecture definitions as their own (for example, container arches are defined to be Go arches). To make it easier for other places to use this mapping, move the code that does the translation of OpenEmbedded arches to Go arches to a library. (From OE-Core rev: 5e0267aeb7d9f575f270f6856a67ac62ce8a0f71) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3e86f72fc2e1cc2e5ea4b4499722d736941167ce) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* cve-check: don't warn if a patch is remoteRoss Burton2023-11-031-5/+6
| | | | | | | | | | | | | | | | We don't make do_cve_check depend on do_unpack because that would be a waste of time 99% of the time. The compromise here is that we can't scan remote patches for issues, but this isn't a problem so downgrade the warning to a note. Also move the check for CVEs in the filename before the local file check so that even with remote patches, we still check for CVE references in the name. (From OE-Core rev: 201f0e1d55ca2fa6ab948a82d94e52c6a77ca7d2) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: slightly more verbose warning when adding the same package twiceRoss Burton2023-11-031-1/+1
| | | | | | | | | | | Occasionally the cve-check tool will warn that it is adding the same package twice. Knowing what this package is might be the first step towards understanding where this message comes from. (From OE-Core rev: 699863be46fab91d5729fce1dc5b795761247f98) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/selftest: fix command argumentsTrevor Gamblin2023-10-171-1/+1
| | | | | | | | | | | | Changes to patchtest's command-line arguments to work with oe-core by default do not match the selftest script's argument list. Explicitly use the --testdir and --repodir flags in selftest so that it is compatible them. (From OE-Core rev: 6cd547b24896596d4e0fe57f26f553842c5560b5) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: update SPDX identifiersTrevor Gamblin2023-10-1729-97/+29
| | | | | | | | | | Replace full license headers with SPDX identifiers and adjust all patchtest-related code to use GPL-2.0-only. (From OE-Core rev: 9bea6b39074296bb8d8719a3300636e316f19d1b) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: set default repo and testdir targetsTrevor Gamblin2023-10-171-2/+7
| | | | | | | | | | | | | | | | | Since patchtest is in oe-core, the Python os module's methods can be used to retrieve the repository path and tests directory by default. This reduces the number of mandatory arguments for invocation of patchtest unless the user wants to use a custom test suite or test patches against a different repo. The REPO and TESTDIR arguments are likewise adjusted so that they are optional. Also, make it more obvious what the --startdir flag is meant for on the command line by renaming it to --testdir, and update the scripts/patchtest.README file to be consistent with the new usage. (From OE-Core rev: bae7421ece4806f5148f164293810b9fe75e0756) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: add supporting modulesTrevor Gamblin2023-10-174-0/+532
| | | | | | | | | | | | Add modules that support core patchtest functionality to meta/lib/patchtest. These include classes and functions for handling repository and patch objects, parsing the patchtest CLI arguments, and other utilities. (From OE-Core rev: 499cdad7a16f6cc256837069c7add294132127a4) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest/requirements.txt: updateTrevor Gamblin2023-10-171-0/+2
| | | | | | | | | Add git-pw and boto3 to the list of requirements for patchtest. (From OE-Core rev: f88e295cb5034950e9a0899c1dc3ca685a30a176) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.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>
* reproducible: Exclude rust for now againRichard Purdie2023-10-131-0/+2
| | | | | | | | | | | | Unfortunately there is still an issue with rustdoc not being reproducible so part of the problem has been fixed but not everything. Add the exclusion back until this has been addressed to avoid autobuilder failures and long diffoscope analysis time. (From OE-Core rev: ab03b3416dda65e39a756c02d87492e1fe5e0fb0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: clean up test suiteTrevor Gamblin2023-10-1312-44/+45
| | | | | | | | | | | | | | | | Various tweaks to make the test suite cleaner and more efficient: - Replace use of "re" module with "pyparsing" in tests (but not base.py) - Make test_mbox_cve only check for CVE tags in the commit if the added patch has them - Make test_mbox_cve SKIP instead of PASS if there's no CVE tag - Simplify the bugzilla tag checking test now that pyparsing is used - Modify the selftest script to correctly parse the new result output (From OE-Core rev: 7a187c2475aa762e2bc830950f608143f2535a72) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patchtest: improve test issue messagesTrevor Gamblin2023-10-1318-52/+29
| | | | | | | | | | | | | | The patchtest tests provide vague feedback to the user, and many of them also provide redundant 'fix' strings that could easily be incorporated into the issue messages themselves. Simplify them so that it is more clear what the errors are and how they can be addressed. No recommendation is given when the issue string adequately conveys the issue, e.g. with a missing "LICENSE" entry in a newly-created recipe. (From OE-Core rev: 0bfb3614244ec7aa79b6424bc63f9f2bccdabe98) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/_qemutiny: rewrite test to be functionalRoss Burton2023-10-111-3/+8
| | | | | | | | | | | | The _qemutiny is a small test case that was explicitly designed to do a minimal level of testing for poky-tiny images. These typically don't have SSH servers so we need to assume that qemu is being used and access the serial console directly. (From OE-Core rev: 2245b2754d6f4798127ce85a2ab7cb48f458c1f7) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: don't skip test_read_only_image on qemuarm64Ross Burton2023-10-111-2/+0
| | | | | | | | | | | | There's no need to skip this test anymore, as skipping on qemuarm64 was a proxy for "uses SERIAL_CONSOLES_CHECK" which no longer exists. [ YOCTO #14962 ] (From OE-Core rev: 1b8b1cb74c8f5f387a14d86f03f37f68c07dd9aa) Signed-off-by: Ross Burton <ross.burton@arm.com> 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>
* rust: reproducibility issue fixSundeep KOKKONDA2023-10-111-2/+0
| | | | | | | | | | | | | | | | | | | | The '--remap-path-prefix' option removes all references to build directory structure in the debug information within the compiled output for Cargo dependencies and the project's binary. However, some references to build directories remains in the final binary in .rustc section in the form of compressed metadata and this makes the build output dependent on the folder structure of the computer it's compiled on. So, for reproducible builds, use the configuration option 'remap-debuginfo = true' along with the '--remap-path-prefix'. [YOCTO# 14875] (From OE-Core rev: 6ae62259afbbe861ed74211dab18a27b8c8d8b7a) Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com> 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>