summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* oeqa/selftest/cve_check: add tests for Ignored and partial reportsMarta Rybczynska2022-06-171-0/+82
| | | | | | | | | | | Add testcases for partial reports with CVE_CHECK_REPORT_PATCHED and Ignored CVEs. (From OE-Core rev: 3f7639b90004973782a2e74925fd2e9a764c1090) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* weston.py: added xwayland testssuesens2022-06-151-0/+8
| | | | | | | | | | | | Test xwayland support if DISTRO_FEATURE X11 is enabled Test checked if xserver listening on display (From OE-Core rev: c8dea13bd65f1695c79eba26b092d411a1699b19) Signed-off-by: ssuesens <sebastian.suesens@baslerweb.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/create-spdx: Add SPDX_PRETTY optionJoshua Watt2022-06-151-2/+2
| | | | | | | | | | | Adds an option to make the SPDX more human-readable (at the expense of a larger files) (From OE-Core rev: 4799594b26f77ed259dc661bf077519b338390c8) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oescripts: change compare logic in OEListPackageconfigTestsMingli Yu2022-06-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When multilib enabled and add layers/meta-openembedded/meta-oe in conf/bblayers.conf, it reports below error when run oe-selftest. $ oe-selftest -r oescripts [snip] [20:36:33-0700] 2022-05-16 03:36:33,494 - oe-selftest - INFO - RESULTS - oescripts.OEListPackageconfigTests.test_packageconfig_flags_option_flags: FAILED (585.37s) [snip] It is because the output of "list-packageconfig-flags.py -f" as below: $ ../scripts/contrib/list-packageconfig-flags.py -f [snip] qt lib32-pinentry lib32-wxwidgets nativesdk-pinentry pinentry pinentry-native wxwidgets wxwidgets-native secret lib32-pinentry nativesdk-pinentry pinentry pinentry-native [snip] But the check logic as below: class OEListPackageconfigTests(OEScriptTests): #oe-core.scripts.List_all_the_PACKAGECONFIG's_flags def check_endlines(self, results, expected_endlines): for line in results.output.splitlines(): for el in expected_endlines: if line.split() == el.split(): expected_endlines.remove(el) break def test_packageconfig_flags_option_flags(self): results = runCmd('%s/contrib/list-packageconfig-flags.py -f' % self.scripts_dir) expected_endlines = [] expected_endlines.append("PACKAGECONFIG FLAG RECIPE NAMES") expected_endlines.append("qt nativesdk-pinentry pinentry pinentry-native") expected_endlines.append("secret nativesdk-pinentry pinentry pinentry-native") self.check_endlines(results, expected_endlines) And the test will fail as line.split() doesn't equal el.split() as line.split() is ['lib32-pinentry', 'lib32-wxwidgets', 'nativesdk-pinentry', 'pinentry', 'pinentry-native', 'wxwidgets', 'wxwidgets-native'] and el.split() is ['nativesdk-pinentry', 'pinentry', 'pinentry-native']. So change the compare logic to fix the gap. (From OE-Core rev: 239f22847bcae0cb31769adb0a42b5440173a7c5) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base/buildhistory/image-buildinfo: Use common buildcfg functionRichard Purdie2022-06-111-0/+7
| | | | | | | | Reduce code duplication to a common function in oe.buildcfg. (From OE-Core rev: 0b191a1df4c3722defb09dde0c16b1d9e7fe7ef6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildcfg: Drop unused svn revision functionRichard Purdie2022-06-111-11/+0
| | | | | | | | | This isn't used anywhere and everyone is using git now, the functions are now hardcoded as such too. Drop this function. (From OE-Core rev: 09ba96a2d7fa02c7a82758bbf4109b04ffca2c55) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/buildcfg: Share common clean/dirty layer functionRichard Purdie2022-06-111-1/+14
| | | | | | | | | The comments even say this was copy/paste code. Move to a shared library function. (From OE-Core rev: ac3de2f850a418673b87e1c454970cb099e191b0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/buildcfg: Move git/layer revision code into new OE module buildcfgRichard Purdie2022-06-111-0/+40
| | | | | | | | | There is a load of duplicated git/layer/revision code which makes most sesne as a python library, not bbclass code. Start to refactor as such. (From OE-Core rev: 439cdf8a1e52fd2c4dc81dc40ce7e6af282ce7ac) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/multiconfig: Test that multiconfigs in separate layers worksRichard Purdie2022-06-111-0/+13
| | | | | | | | | | | | | We should test that mutliconfigs from a layer work, not just build/conf. This adds such a test. [YOCTO #13566] (From OE-Core rev: 2306261fb85d5d03145989c3af9c6897111644ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: close kernel_abi_ver_fileMartin Jansa2022-06-081-1/+3
| | | | | | | | | | | | * fixes: oe-core/meta/lib/oe/rootfs.py:331: ResourceWarning: unclosed file <_io.TextIOWrapper name='pkgdata/mach/kernel-depmod/kernel-abiversion' mode='r' encoding='UTF-8'> kernel_ver = open(kernel_abi_ver_file).read().strip(' \n') (From OE-Core rev: f9dd8ee063c1132265248457fcd628e1e93727be) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: find .ko.zst kernel modulesSean Anderson2022-06-061-1/+1
| | | | | | | | | | | With CONFIG_MODULE_COMPRESS_ZSTD enabled, kernel modules will have a .ko.zst extension. This fixes depmod not being run. Fixes: 1b696a45ddb ("rootfs.py: Add check for kernel modules before running depmod") (From OE-Core rev: 425efac7110f0f42d70643e0a448e834d0f01a7a) Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: move update_symlinks to a libraryMarta Rybczynska2022-06-061-0/+10
| | | | | | | | | Move the function to a library, it could be useful in other places. (From OE-Core rev: debd37abcdde8788761ebdb4a05bc61f7394cbb8) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* patch.py: make sure that patches/series file exists before quilt popMartin Jansa2022-05-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Since quilt upgrade to 0.67 some recipes sometimes fail in do_patch with errors like: ERROR: Applying patch 'GPLv2.patch' on target directory '/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/keymaps/1.0-r31' CmdError('quilt --quiltrc /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/keymaps/1.0-r31/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: stderr: File series fully applied, ends at patch GPLv2.patch ') * It affects only recipes with S = "${WORKDIR}", which wipe only ${S}/patches, because in other cases whole ${S} is wiped when do_unpack is re-executed. * It was originally added in: https://git.openembedded.org/openembedded-core/commit/?id=5fe5e6a15f26f23f0c5b863fafad7a0d382a55e2 since then it was extended to wipe whole ${S} when ${S} != ${WORKDIR} in: https://git.openembedded.org/openembedded-core/commit/?id=5fe5e6a15f26f23f0c5b863fafad7a0d382a55e2 https://git.openembedded.org/openembedded-core/commit/?id=eccae514b71394ffaed8fc45dea7942152a334a1 this is now causing issues to quilt-0.67 because it checks that ${S}/patches/series exists during 'quilt pop -a -f' which we call from QuiltTree.Clean to undo patches possibly already applied in ${S} in previous do_patch execution. * There are couple recipes affected by this e.g. keymaps (.patch already removed in oe-core), makedevs (.patch removal sent to ML yesterday https://lists.openembedded.org/g/openembedded-core/message/166172), devmem2 (https://lists.openembedded.org/g/openembedded-devel/message/97270), but there are other recipes with S = "${WORKDIR}" where you can trigger this e.g. by having a .patch file in DISTRO layer .bbappend (e.g. tzdata with webOS https://github.com/webosose/meta-webosose/blob/06e5298d9f5c47679b679081d9930f8d1c776142/meta-webos/recipes-extended/tzdata/tzdata.bbappend#L10) This do_patch issue is caused by: https://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=8b39a960afcf45cd4f5804ae62b6b0656bdb191d introduced in kirkstone with: https://git.openembedded.org/openembedded-core/commit/?h=kirkstone&id=fa71afcee9ab42198c619333b77a15bd2ae02b20 The shortest sequence to reproduce this is just bitbake keymaps -c patch bitbake keymaps -c unpack -f bitbake keymaps -c patch with https://git.openembedded.org/openembedded-core/commit/?id=17d981005a0c0c97702ad88602b7181b69bcc9eb reverted. And the change in quilt behavior is causing QuiltTree.Clean (quilt pop -a -f) in: https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/patch.py?id=17d981005a0c0c97702ad88602b7181b69bcc9eb#n601 to silently fail with "No series file found" before undoing the patches in ${S} and then quilt push failing, because all the patches are _still_ applied in ${S}. Removing ".pc" doesn't help, because we really need quilt's help to undo the patches (in this case to delete COPYING file from WORKDIR before applying the .patch which tries to add it again), because do_unpack cannot just wipe S and start over (because S == WORKDIR) - nor selectively removing the files listed in SRC_URI, because COPYING file isn't listed there. Using skip_series_check in 'quilt pop' (partially reverting the change from upstream) does fix this as well and it's simple one line patch (just adding skip_series_check=1 in pop.in), but might be difficult to upstream, because it's this strange OE specific behavior that we remove 'patches' directory and then still need quilt pop to work. (From OE-Core rev: c9d36882044b1c633d8611a77df54cd68c9bee25) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/imagefeatures: Disable squashfs-lzoRichard Purdie2022-05-291-1/+1
| | | | | | (From OE-Core rev: c8c8b5265c831a2827a3891c7b326b25eae7f681) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/imagefeatures: Replace lzo with zstRichard Purdie2022-05-291-2/+2
| | | | | | | | We may remove lzo so switch the test case to zstd. (From OE-Core rev: f749a8b462b915713912342444f981125938a990) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/wic.py: Repaired test_qemu()Tobias Schmidl2022-05-271-1/+1
| | | | | | | | | | The grep is too wide, so it falsely fits additional lines that have a UUID (i.e, `/`). (From OE-Core rev: f72fdea1c890ddd793aa63bb9c1c0857962161cc) Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cve_check: add tests for recipe and image reportsRoss Burton2022-05-201-1/+76
| | | | | | | | | | | | | Add a test to verify that the JSON reports are generated correctly for both single recipe builds and image builds. More tests are needed, but this is better than nothing. (From OE-Core rev: df0f35555b09c4bc75470eb45ec9c74e6587d460) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/imagefeatures/overlayfs: Always append to DISTRO_FEATURESRichard Purdie2022-05-162-9/+9
| | | | | | | | | | Using += unintentionally removes all other entries from DISTRO_FEATURES if DISTRO_FEATURES was set by ?= such as by poky.conf. This reduces sstate reusage on the autobuilder. Fix this to speed up builds. (From OE-Core rev: 124b82c32c4545bb216a8249954817f692f9795a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* virgl: skip headless test on alma 8.6Steve Sakoman2022-05-151-1/+1
| | | | | | | | | | | As a centos 8 spinoff, it lacks the same vgem kernel module. (From OE-Core rev: 451605aa40482516c18cd1534feacb796516a785) (From OE-Core rev: 8f74418637fbcdd7c68636ec1b9adfffc245f9c1) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: add test for git working correctly inside pseudoRoss Burton2022-05-071-0/+15
| | | | | | | | | | | | | The fix for CVE-2022-24765 in git[1] breaks any use of git inside pseudo. Add a simple test case to oe-selftest to verify that at least basic uses of git work fine under pseudo. [1] https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 (From OE-Core rev: 46822268040a23dbb81f71fe35aee8c2663a31f6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: rootfs-postcommands: add skip option to overlayfs_qa_checkClaudius Heine2022-05-031-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overlayfs_qa_check checks if the current root file system has a mount configured for each overlayfs, when the overlayfs class is used. However there are certain instances where this mount point is created at runtime and not static in a fstab entry or systemd mount unit. One such case would be if overlayfs-etc is used, where the device is mounted in the preinit script and not via a mount unit or fstab entry. However there are other possibilities for this as well, like startup scripts that support a dynamic partition layout. For instance when systemd-repart is used. This adds the `OVERLAYFS_QA_SKIP` variable, which allows to define QA skips via its flags. In principle it supports multiple QA skip flags separated by whitespace, but only one (`mount-configured`) is implemented here. To skip this QA check simply add `mount-configured` to the flag of `OVERLAYFS_QA_SKIP` with the same name. For instance if a overlayfs is configured as: OVERLAYFS_MOUNT_POINT[data] = "/data" Skipping this QA check can be done by setting: OVERLAYFS_QA_SKIP[data] = "mount-configured" Also add a testcase and fix a typo (fstat -> fstab). (From OE-Core rev: 2ce9173169a2a86392c4a85fe9be7fbbd7353b7f) Signed-off-by: Claudius Heine <ch@denx.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/sstatesig: Fix find_siginfo to match sstate filename generationRichard Purdie2022-04-291-2/+2
| | | | | | | | | | | | | | | | sstate filename generation was changed a while ago and taskname has to be passed into core functions for the correct filename to be generated. Update find_siginfo to match those changes and pass in taskname via SSTATE_CURRTASK. Thanks to Gregory Lumen <gregorylumen@microsoft.com> for spotting. [YOCTO #14774] (From OE-Core rev: 51d7310b6cf8ef9033d461868c07f686656070ba) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve_check: skip remote patches that haven't been fetched when searching for ↵Ross Burton2022-04-281-2/+3
| | | | | | | | | | | | | | | | | CVE tags If a remote patch is compressed we need to have run the unpack task for the file to exist locally. Currently cve_check only depends on fetch so instead of erroring out, emit a warning that this file won't be scanned for CVE references. Typically, remote compressed patches won't contain our custom tags, so this is unlikely to be an issue. (From OE-Core rev: cefc8741438c91f74264da6b59dece2e31f9e5a5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cases/buildepoxy.py: fix typoChen Qi2022-04-261-1/+1
| | | | | | | | (From OE-Core rev: 3a9b6e71d1e7e8e2ebc0ed047841e36f09300387) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* terminal.py: Restore error output from TerminalPeter Kjellerstedt2022-04-261-1/+2
| | | | | | | | | | | | | In bitbake commit 1ecc1d94 (process: Do not mix stderr with stdout), bb.process.Popen() was changed to no longer combine stdout and stderr by default. However, the Terminal class was not updated to reflect this and subsequently only output stdout in case of failures. (From OE-Core rev: 116d0bb07ba044cf8847bf3d5c3996ad7e58b7ae) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* apt: add apt selftest to test signed package feedsFerry Toth2022-04-192-7/+69
| | | | | | | | | | | | | | | | | Since Gatesgarth apt (1.8.2) has become more strict and doesn’t allow unsigned repositories by default. Currently when building images this requirement is worked around by using [allow-insecure=yes] and equivalently when performing selftest. Patches "gpg-sign: Add parameters to gpg signature function" and "package_manager: sign DEB package feeds" enable signed DEB package feeds. This patch adds a runtime test for apt derived from the test_testimage_dnf test. It creates a signed deb package feed, runs a qemu image to install the key and performs some package management. To be able to install the key the gnupg package is added to the testimage. (From OE-Core rev: 3ec30490d09d6639eea2638cf12a323948f221cc) Signed-off-by: Ferry Toth <ftoth@exalondelft.nl> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/lic_checksum: Add test for filename containing spacePaulo Neves2022-04-191-0/+18
| | | | | | | | | | | A fix is being added to bitbake to correctly handle spaces inside checksum filenames. Add a test to oe-selftest to ensure this is tested and doesn't regress in future. (From OE-Core rev: 324109f034f069ee3e91a1a705b3449911a448de) Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: sign DEB package feedsFerry Toth2022-04-051-3/+16
| | | | | | | | | | | | | | | | | | Implement debian package repository signature. For each Release file created in repository subdirectory, a signature Release.gpg is created. Signature is performed using gpg backend when the following variables are set in local.conf: PACKAGE_CLASSES += "sign_package_feed" PACKAGE_FEED_GPG_NAME = "<Id of GPG key>" PACKAGE_FEED_GPG_PASSPHRASE_FILE="<path to password file>" (From OE-Core rev: fcc3cee276999efe6402959eb295e7a0e1e96f96) Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net> Signed-off-by: Ferry Toth <ftoth@exalondelft.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gpg-sign: Add parameters to gpg signature functionXavier Berger2022-04-051-1/+5
| | | | | | | | | | | output_suffix: If defined, add output_suffix as file name extension. use_sha256: If True, use sha256 for gpg as digest algorithm (From OE-Core rev: cfcaa54dc73925df448099fb60f75b18350b2a3b) Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net> Signed-off-by: Ferry Toth <ftoth@exalondelft.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: generalise test_devtool_virtual_kernel_modifyRoss Burton2022-04-011-21/+17
| | | | | | | | | | | | | | | | | | | Generalise this test so that it works on more than qemux86-64: - Don't edit a file in arch/x86 to cause a rebuild, instead use init/ - Look for the edits in the build tree, as the deployed kernel could be of any type (zImage/bzImage/etc) and edits may be in the compressed part. Also remove redundant checks on the result of runCmd(), as this will raise AssertionError exceptions itself so the explicit asserts will never trigger. (From OE-Core rev: f1d2b2ec51f748a28d1bca6615558d553876e5c3) 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>
* oeqa/selftest/wic: use self.td instead of get_bb_var to save on bitbake callsRoss Burton2022-04-011-16/+12
| | | | | | | | | | | | | | | | When a test case starts, self.td is populated with all the variables in the data store. Typically this can be used instead of get_bb_var(), which saves a bitbake call per variable lookup. The only catch is that in parallel runs the build directory is moved after td is populated, so paths in the build directory are wrong: these still need to be fetched in the test. (From OE-Core rev: 884201c6c1bbf7c1b958bab7d7c91e27577eeaac) 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>
* oeqa/selftest/wic: use os.path.join to join pathsRoss Burton2022-04-011-46/+46
| | | | | | | | | | Instead of using string concatenation, use os.path.join. (From OE-Core rev: 73d1b7163792ec089ffb3bf99f1b4f8760beaea7) 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>
* oeqa/selftest/wic: rearrange testsRoss Burton2022-04-011-77/+77
| | | | | | | | | | | | Split the tests into further classes: one which exercises the CLI and doesn't need to build images at all, and another which is just the tests that manipulate existing images. (From OE-Core rev: c9bc4def71325dba7b7ad93001f7fe1acced0bea) 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>
* oeqa/selftest/wic: cleanup WicTestCase.setUpLocalRoss Burton2022-04-011-8/+4
| | | | | | | | | | | Use os.path.join to construct paths, and invoke bitbake once instead of three times. (From OE-Core rev: 27953d4cf6edc86cd505826c3da21222864c7760) 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>
* oeqa/selftest/oescripts: refactor skipping logicRoss Burton2022-04-011-9/+5
| | | | | | | | | | | | | | | | | OEScriptTests currently skips if cairo isn't present, and does a build of core-image-minimal. This is only required for the OEPybootchartguyTests tests, so move that logic there so that the OEListPackageconfigTests run even if cairo isn't available. This leaves OEScriptTests as a simple class containing the scripts_dir assignment, which can then be reused by other tests to avoid code duplication. (From OE-Core rev: fe3ee517772ad8396fcac21ae7eb8d1c8b68fbdb) 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>
* oeqa: rationalise skipifqemu decoratorsRoss Burton2022-04-018-51/+25
| | | | | | | | (From OE-Core rev: 1a3a37cc2b16a8d5cd2258b0b35be43baa363f67) 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>
* oeqa/selftest: tag tests that use runqemuRoss Burton2022-04-018-6/+32
| | | | | | | | | | | There may be environments or machines which don't have working runqemu, so tag all of the tests which use runqemu() so that they can be skipped. (From OE-Core rev: 3f45ce6d2b1dfde8bc3d554397d55f81846c52d5) 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>
* oeqa/core/decorators/data: improve has_* logicRoss Burton2022-04-011-3/+3
| | | | | | | | | | | | | has_feature() should be splitting the feature string into substrings and then looking for membership instead of looking for simple substrings. has_machine() should be using equality instead of substrings. (From OE-Core rev: a4c63819234e252c58e040af8bbdbfb96b6feccf) 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>
* oeqa/selftest: remove unused importsRoss Burton2022-04-0120-35/+14
| | | | | | | (From OE-Core rev: 7ef7b03eeefc0a9911fd62c73e346fa5aeeb09eb) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/utils/misc: remove redundant fileRoss Burton2022-04-011-47/+0
| | | | | | | | | | | This file dates back to 2016. Half of the functions have never been used, the rest are used in one place and have now been replaced. (From OE-Core rev: 5a053b2a84e7a671925fb4a78005145786c57f6a) 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>
* oeqa/core/decorator: remove redundant codeRoss Burton2022-04-011-8/+3
| | | | | | | | | | | There's no need to wrap *tags in a potential list, as *tags will always be a tuple. (From OE-Core rev: 54210c518bcb76d80c8ec9564d1ddf344e9d8924) 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>
* oeqa/runtime/decorator/package.py: remove use of strToSetRoss Burton2022-04-011-3/+6
| | | | | | | | | | | There's no need to use a series of over-generalised functions to just wrap a string in a tuple. (From OE-Core rev: 080854fe346a76f5fbe25058ba1b2425a0459b5e) 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>
* oeqa/selftest/buildoptions: set PACKAGE_CLASSES in ↵Ross Burton2022-04-011-1/+6
| | | | | | | | | | | | | test_arch_work_dir_and_export_source test_arch_work_dir_and_export_source uses the archiver to generate SRPMS, so explicitly set PACKAGE_CLASSES to ensure that package_rpm is used. (From OE-Core rev: 030157fa8dd405be60c55523e074b2ec950d36ad) 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>
* oeqa/selftest/wic: add more arch-specific annotationsRoss Burton2022-04-011-4/+10
| | | | | | | | | | | | Some tests which are marked as x86-specific will actually work on aarch64 (e.g. use EFI), whilst some other tests really are x86-specific (e.g. use syslinux). (From OE-Core rev: 1285bdaa4f472519083c03946ee34c7d8c204e27) 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>
* oeqa/selftest/wic: don't hardcode kernel image type in test_wic_rmRoss Burton2022-04-011-4/+6
| | | | | | | | | | Don't assume bzImage, resepct KERNEL_IMAGETYPE. (From OE-Core rev: f03d47833593734489e73f054f41c3dbbe423204) 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>
* oeqa/selftest/wic: clean up only_for_arch decoratorRoss Burton2022-04-011-9/+5
| | | | | | | | | | | | There's no need to pass a recipe name when determining the target architecture, there's no need to cap the size of the lru_cache as it will only have one entry, and __name__ is set by @wraps. (From OE-Core rev: e8e6c679f6eb74cb25c124a18af88dd5c2e2c833) 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>
* oeqa/selftest/wic: remove redundant assertsRoss Burton2022-04-011-12/+12
| | | | | | | | | | | By default bitbake() will raise an assertion if it fails, so there's no need to wrap it in a further assert. (From OE-Core rev: de3c8994dc482cf5e9f3317c4762fe4ac35d9f31) 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>
* oeqa/selftest/wic: use os.rename instead of bb.utils.renameRoss Burton2022-04-011-3/+4
| | | | | | | | | | | bb.utils.rename() only exists to handle moves across filesystems. As these moves are within the same directory we can just use os.rename(). (From OE-Core rev: 450e09b6d4ca019848aec4c62fce280a09395b97) 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>
* oeqa/selftest/devtool: ensure Git username is set before upgrade testsRoss Burton2022-04-011-0/+8
| | | | | | | | | | | The 'devtool upgrade' tests fail if Git doesn't know the user's name or email, so verify this before the tests start and skip if it is not. (From OE-Core rev: b4d8aca97a1ead38ce55f3bb5859d3d05d9dd84f) 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>
* cve-check: add json formatMarta Rybczynska2022-03-301-0/+16
| | | | | | | | | | | | | | | | | | | | | Add an option to output the CVE check in a JSON-based format. This format is easier to parse in software than the original text-based one and allows post-processing by other tools. Output formats are now handed by CVE_CHECK_FORMAT_TEXT and CVE_CHECK_FORMAT_JSON. Both of them are enabled by default. The JSON output format gets generated in a similar way to the text format with the exception of the manifest: appending to JSON arrays requires parsing the file. Because of that we first write JSON fragments and then assemble them in one pass at the end. (From OE-Core rev: df567de36ae5964bee433ebb97e8bf702034994a) Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>