summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
AgeCommit message (Collapse)Author
2024-03-07selftest: skip virgl gtk/sdl test on ubuntu 18.04Steve Sakoman
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-26meta/lib/oeqa: python 3.12 regexAdrian Freihofer
Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Cherry-picked from master: 9002850f0c2e409d3bc629e36bb360b96326bb64 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-26oeqa/selftest/oelib/buildhistory: git default branchAdrian Freihofer
On hosts with git defaulting to main branch the following exception occures: File .../buildhistory.py", line 99, in test_compare_dict_blobs_default blob1 = self.repo.heads.master.commit.tree.blobs[0] ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/git/util.py", line 1114, in __getattr__ return list.__getattribute__(self, attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'IterableList' object has no attribute 'master' Support main and master branch for these test cases. Note: setting the default branch with --initial-branch requires git version 2.28 or later. Some of the still supported host distros do not provide this feature yet. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Cherry-picked from master: 7df99843d8f31d8e0c2872ff625f4a5abf28f740 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-26oeqa/selftest/recipetool: expect meson.bbAdrian Freihofer
Latest recipetool from master branch generates a pyhton3-meson.bb recipe while the older version from kirkstone generates a meson.bb. Change the test to pass with meson.bb. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-26oeqa/selftest/recipetool: downgrade meson version to not use pyproject.tomlRoss Burton
recipetool's pyproject.toml parsing needs tomllib (python 3.11+) or tomli (not a hard dependency), so is prone to failing depending on the host configuration. Downgrade the Meson release used for the checks to 0.52.1, which was the last release before moving to pyproject.toml. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 6dfe573d83687e5431841f062442b54b9fa22ff3 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-26oeqa/selftest/recipetool: fix for python 3.12Adrian Freihofer
test_recipetool_create_github and test_recipetool_create_github_tarball fail because the old meson version used by these tests cases does not run on Python 3.12. The issue is in the dependencies.py which comes with meson: ERROR: build/tmp/work/recipetool-3z4osyl7/source/git/mesonbuild/ dependencies.py:777: SyntaxWarning: invalid escape sequence '\.' Use meson 1.3.1 (what is currently also used on master) as a reference for these tests. With this version of meson, recipetool creates recipes named meson_git.bb or meson_1.3.1.bb. Since this looks more reasonable than e.g. python3-meson_git.bb the test gets adapted. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 7374a8a2810a6cf027bfefefe87691a3529123ff Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-26oeqa: replace deprecated assertEqualsAdrian Freihofer
assertEquals is deprecated since Python 2.7: https://docs.python.org/2/library/unittest.html#deprecated-aliases It throws errors at least on Python 3.12. Replace it by assertEqual. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 68286d0b70cf09a0d2950b48945c9192fb8c8769 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-02-24oeqa/selftest/runtime_test: only run the virgl tests on qemux86-64Ross Burton
These tests should be able to work on qemuarm64, but this is untested and the runners will need configuration. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 09b9558e20e58b473154895b93cff16261c7f561) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-08-22selftest/cases/glibc.py: switch to using NFS over TCPAnuj Mittal
This provides a more reliable test execution when running tests that write a large buffer/file and significantly reduces the localedata test failures. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 97a7612e3959bc9c75116a4e696f47cc31aea75d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-08-22selftest/cases/glibc.py: increase the memory for testingAnuj Mittal
Some of the tests trigger OOM and fail. Increase the amount of memory available so we dont run into these issues. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4d22dba482cb19ffcff5abee73f24526ea9d1c2a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-08-22selftest/cases/glibc.py: fix the override syntaxAnuj Mittal
Fix the override so we actually pass the correct value to glibc. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 38fd2120f0f48512091ddad6205ce19839eaf589) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-31oeqa/selftest/devtool: add unit test for "devtool add -b"Yoann Congal
Fix [Yocto #15085] Co-authored-by: Fawzi KHABER <fawzi.khaber@smile.fr> Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d5eedf8ca689ccb433c2f5d0b324378f966dd627) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-17selftest/reproducible: Allow chose the package managerJose Quaresma
This is a follow-up of 76e5fcb2 that also allow users to chose the package manager using OEQA_REPRODUCIBLE_TEST_PACKAGE Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3d414d85b44077bac57aba36707b0fc699a73e97) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-17selftest reproducible.py: support different build targetsMikko Rapeli
Allow users to set different build reproducibility targets than the defaults using OEQA_REPRODUCIBLE_TEST_TARGET and OEQA_REPRODUCIBLE_TEST_SSTATE_TARGETS variables in local.conf. Fixing all issues from "world" builds is not possible in some complex build environments with lots of layers. Limiting the focus to a smaller subset allows using this test to detect and fix build reproduction issues incrementally. Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit c66bebbce5995e386a1a4d055a914a39b6ee518d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-07-05oeqa/selftest/bbtests: add non-existent prefile/postfile testsFabien Mahot
Fixes [YOCTO #10725] Signed-off-by: Fabien Mahot <fabien.mahot@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b0c33655fad5b2e7d96a45b6210527dfb766797b) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-19oeqa/selftest/cases/devtool.py: skip all tests require folder a git repoThomas Roos
Devtool selftests require poky dir a git repo, when downloading poky as a tar, this is not the case. Those tests will now skipped. [YOCTO #12389] Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 95a5bc130dc51ea9de95c64dbf0e9c7892415d50) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-06-09selftest/reproducible: Allow native/cross reuse in testRichard Purdie
We don't compare reproducibility of the native/cross components, only the target ones. With the long build times of rust-native, the test now takes crazy lengths of time so this tweak should allow us to reuse native/cross artefacts from sstate whilst still testing the target output is reproducible. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b494d83c639a877cefeb7cbab6d37195e492f059) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-03-30selftest: devtool: set BB_HASHSERVE_UPSTREAM when setting SSTATE_MIRRORMartin Jansa
* with my build/conf/local.conf: SSTATE_DIR = "/OE/build/poky/build/sstate-cache" these devtool tests will first set own SSTATE_DIR and the original one set as SSTATE_MIRROR: 2023-03-11 11:51:46,837 - oe-selftest - INFO - test_devtool_update_recipe_append (devtool.DevtoolUpdateTests.test_devtool_update_recipe_append) 2023-03-11 11:51:46,846 - oe-selftest - DEBUG - Appending to: /OE/build/poky/build/build-st-2023-03-11-patch2/devtool.DevtoolUpdateTests.test_devtool_update_recipe_append/build-st/conf/selftest.inc SSTATE_DIR = "/OE/build/poky/build/build-st-2023-03-11-patch2/devtool.DevtoolUpdateTests.test_devtool_update_recipe_append/build-st/sstate_devtool" SSTATE_MIRRORS += "file://.* file:////OE/build/poky/build/sstate-cache/PATH" * but that unfortunately leads to a warning from sanity.bbclass about SSTATE_MIRRORS without matching BB_HASHSERVE, because BB_HASHSERVE is set to "auto" by default these tests failing with: 2023-03-11 11:55:39,610 - oe-selftest - INFO - ====================================================================== 2023-03-11 11:55:39,610 - oe-selftest - INFO - FAIL: test_devtool_update_recipe_append_git (devtool.DevtoolUpdateTests.test_devtool_update_recipe_append_git) 2023-03-11 11:55:39,610 - oe-selftest - INFO - ---------------------------------------------------------------------- 2023-03-11 11:55:39,611 - oe-selftest - INFO - Traceback (most recent call last): File "/OE/build/poky/meta/lib/oeqa/selftest/cases/devtool.py", line 1118, in test_devtool_update_recipe_append_git self.assertNotIn('WARNING:', result.output) AssertionError: 'WARNING:' unexpectedly found in 'NOTE: Starting bitbake server...\nWARNING: You are using a local hash equivalence server but have configured an sstate mirror. This will likely mean no sstate will match from the mirror. You may wish to disable the hash equivalence use (BB_HASHSERVE), or use a hash equivalence server alongside the sstate mirror.\nLoading cache...done.\nLoaded 0 entries from dependency cache.\nParsing recipes...done.\nParsing of 947 .bb files complete (0 cached, 947 parsed). 1764 targets, 52 skipped, 0 masked, 0 errors.\n\nSummary: There was 1 WARNING message.\nINFO: Updating SRCREV in recipe mtd-utils-selftest_git.bb\nNOTE: Writing append file /tmp/devtoolqa1m2lh02v/layer/recipes-devtools/mtd/mtd-utils-selftest_git.bbappend' ---------------------------------------------------------------------- * just setting BB_HASHSERVE to empty doesn't work, because then we would need to disable OEEquivHash as well as it fails with: ERROR: OEEquivHash requires BB_HASHSERVE to be set Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 96d4392ee9c5c3674e5c4c4512f527a2ca6765e4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-03-30cve-check: Fix false negative version issueGeoffrey GIRY
NVD DB store version and update in the same value, separated by '_'. The proposed patch check if the version from NVD DB contains a "_", ie 9.2.0_p1 is convert to 9.2.0p1 before version comparison. [YOCTO #14127] Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr> Signed-off-by: Geoffrey GIRY <geoffrey.giry@smile.fr> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 7d00f6ec578084a0a0e5caf36241d53036d996c4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-03-17selftest/recipetool: Stop test corrupting tinfoil classRichard Purdie
Running recipetool.RecipetoolTests.test_recipetool_handle_license_vars followed by wic.Wic2.test_biosplusefi_plugin_qemu would show a failure of: File "/media/build/poky/meta/lib/oeqa/utils/commands.py", line 351, in runqemu qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype) File "/media/build/poky/meta/lib/oeqa/targetcontrol.py", line 116, in __init__ use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) File "/media/build/poky/meta/lib/oe/types.py", line 182, in qemu_use_kvm if kvm and boolean(kvm): File "/media/build/poky/meta/lib/oe/types.py", line 128, in boolean raise ValueError("Invalid boolean value '%s'" % value) ValueError: Invalid boolean value '/media/build/poky/meta/files/common-licenses' which made no sense until you realise the recipetool test is corrupting the tinfoil class. Work on a copy instead to avoid this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7fe76fe17f67c1bbd108d02836692fed20d24771) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-03-17selftest/runtime_test/virgl: Disable for all Rocky LinuxMichael Halstead
RHEL compatible kernels do not support vgem so we disable virgl headless testing. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 78bc1ba2361249ec845d1b9e28d429a37dd83910) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-03-14oeqa/selftest/prservice: Improve debug output for failureRichard Purdie
We keep seeing this failure on the autobuilder but the output amounts to "False is not True". Improve the debug message on the chance it may make the issue clearer. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d03f4cf19c2cc96e9d942252a451521dfec42ebc) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-03-06oeqa/selftest/resulttooltests: fix minor typoAlexis Lothoré
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 80cfa56d133bd3abbb1f37272607d8e15ce70861) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-02-20oeqa/selftest/bbtests: Update message lookup for test_git_unpack_nonetwork_failAlexandre Belloni
bitbake's output changed, update the test Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7e64b63f96dd1d71e263e7bbbe6591e51e98395a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-02-11oeqa/selftest/locales: Add selftest for locale generation/presenceLouis Rannou
[YOCTO #9070] Add a new selftest to validate locale generation. This selftest builds a complete target with GLIBC_GENERATE_LOCALES, IMAGE_LINGUAS, ENABLE_BINARY_LOCALE_GENERATION set. Signed-off-by: Louis Rannou <lrannou@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 53258fd810bea6475af9f908f7b712a13a02b628) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-01-19selftest/virgl: use pkg-config from the hostAlexander Kanavin
The check needs to report dri location on the host machine, so pkg-config binary needs to be capable of finding the needed dri.pc file on the host, and therefore needs to know where host .pc files are located. This may not be the case when using pkg-config from buildtools, so this forces usage of host pkg-config. runqemu already does the same PATH tweak, so this simply brings the two in sync. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit f0521f8a3ba7e15482756529ee7b0a95b3d53e7d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-12-17oeqa/selftest/externalsrc: add test for srctree_hash_filesPeter Marko
Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 7b9728e5b8bdf1193c1304ec3beeca4b5bf8d2da) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-12-09oeqa/selftest/tinfoil: Add test for separate config_data with ↵Richard Purdie
recipe_parse_file() We've seen two different regressions in this API since it is used by layer-index but not be the core code. Add a test for it to try and ensure we don't break it again. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit b07de5de43ec9c9a2c5d496a64940ccdc5b47cf8) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-11-17oeqa/selftest/minidebuginfo: Create selftest for minidebuginfoNathan Rossi
Add a new selftest to validate minidebuginfo support. This selftest builds a complete target image with PACKAGE_MINIDEBUGINFO enabled. ELFs included in the image are expected to have minidebuginfo included in the resulting executables and shared libraries, the self test validates this by unpacking the image and checking for the associated ".gnu_debugdata" section on busybox and libc ELFs. Signed-off-by: Nathan Rossi <nathan.rossi@digi.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 5063a31ad05b75ec6ac12158fe759e81fcdb1585) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-11-17oeqa/selftest/lic_checksum: Cleanup changes to emptytest includeNathan Rossi
Config written to the emptytest include file is invalid after the test has cleaned up its temporary directories resulting in the emptytest recipe potentially having invalid content when parsed by successive bitbake runs. This presents the following error in tests after lic_checksum execution, e.g. 'oe-selftest -r lic_checksum recipetool' ERROR: .../emptytest.bb: Unable to get checksum for emptytest SRC_URI entry tmpn_nyosnq: file could not be found Remove the recipe include content once the bitbake runs are completed in each lic_checksum test case. Signed-off-by: Nathan Rossi <nathan.rossi@digi.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 087df767a64b271b503d714df3df6d8b3caad1c0) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-09-06meta: introduce UBOOT_MKIMAGE_KERNEL_TYPEMing Liu
Sometimes an end user might want to choose another kernel type argument for uboot-mkimage other than "kernel", for instance: "kernel_noload". Let's introduce a variable UBOOT_MKIMAGE_KERNEL_TYPE to support that, and it could be used by BSP layers as well. (From OE-Core rev: e288686e97de1265eeeaf452141e1473867efb1b) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4eb7bbcc2f08b25387a15b7e4a89ef199783c973) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-08-31oeqa/gotoolchain: set CGO_ENABLED=1Ross Burton
In cross-compiles CGO_ENABLED=1 needs to be set explicitly, as otherwise Go refuses to use it even if CC is already set. This fixes the selftest on setups where the host and the SDK target don't have matching architectures. [ YOCTO #14859 ] (From OE-Core rev: 19be072619d39267df44f23c4c8b64f3808f6148) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-08-31oeqa/gotoolchain: put writable files in the Go module cacheRoss Burton
By default 'go mod' creates read-only files, but that just complicates things. Add -modcacherw to make the cache read/write, so it can be cleaned up without needing to chmod. (From OE-Core rev: 7ff30e0d9fe8527cbc2f8ca84e0300fdc84663b6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-08-31oeqa/selftest: rename git.py to intercept.pyRoss Burton
By naming this test class git.py, any attempt to import GitPython (as needed by oelib.buildhistory) failed. As this class exercises the intercepts, rename it to intercept.py. (From OE-Core rev: d557cbbf86767bc2ebf2beb3d70af3b3ca5e0529) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-08-17selftest/wic: Tweak test case to not depend on kernel sizeRichard Purdie
The current test assumes the kernel size leaves a certain amount of whitespace in the output. Improve this constraint so a slightly larger kernel doesn't fail the test. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bd60c44bef4a1b5d3c8fe77a9e6d3a8f43b0dea4) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-07-17selftest/runtime_test/virgl: Disable for all almalinuxRichard Purdie
We can't support vgem on RHEL derived distros so disable this test for all almalinux hosts rather than specific versions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e921f3c1b917072e4c5a110c7dfeeadd2e571bde) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-07-17oe-selftest: devtool: test modify git recipe building from a subdirPaul Eggleton
Add a test that verifies that devtool modify + devtool finish do the right thing on a recipe that fetches from git and sets S to point to a subdirectory of the source tree. We have a few examples among the core recipes, dos2unix is a convenient one so let's use that. (The test first verifies that that is still true in case the recipe is changed in future.) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a84d9ed14173b0bf467ea78dff4f0f7bae0bc082) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-07-01recipetool/devtool: Fix python egg whitespace issues in PACKAGECONFIGThomas Roos
Substitute expressions or whitespace from python egg requires.txt when generating PACKAGECONFIG Pysetuptools sees the uvicorn.egg-info/requires.txt as extra requirements. Recipetool parses this information to generate the PACKAGECONFIG. These extra requirements contain expressions and whitespace, which are not allowed in PACKGAGECONFIG. This patch substitute them by hyphens to make PACKAGECONFIG parsable and readable. Also adding an oe-selftest for this. [YOCTO #14446] Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a854d95a79e64f3f82abfa4cc1daec750abf4249) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-06-20oeqa/selftest/cve_check: add tests for Ignored and partial reportsMarta Rybczynska
Add testcases for partial reports with CVE_CHECK_REPORT_PATCHED and Ignored CVEs. 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> (cherry picked from commit 3f7639b90004973782a2e74925fd2e9a764c1090) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-06-15oescripts: change compare logic in OEListPackageconfigTestsMingli Yu
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. 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> (cherry picked from commit 239f22847bcae0cb31769adb0a42b5440173a7c5) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-06-15selftest/multiconfig: Test that multiconfigs in separate layers worksRichard Purdie
We should test that mutliconfigs from a layer work, not just build/conf. This adds such a test. [YOCTO #13566] 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> (cherry picked from commit 2306261fb85d5d03145989c3af9c6897111644ae) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-05-24oeqa/selftest/cve_check: add tests for recipe and image reportsRoss Burton
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. 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> (cherry picked from commit df0f35555b09c4bc75470eb45ec9c74e6587d460) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-05-22selftest/imagefeatures/overlayfs: Always append to DISTRO_FEATURESRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 124b82c32c4545bb216a8249954817f692f9795a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-05-22classes: rootfs-postcommands: add skip option to overlayfs_qa_checkClaudius Heine
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). 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> (cherry picked from commit 2ce9173169a2a86392c4a85fe9be7fbbd7353b7f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-05-15virgl: skip headless test on alma 8.6Steve Sakoman
As a centos 8 spinoff, it lacks the same vgem kernel module. (From OE-Core rev: 451605aa40482516c18cd1534feacb796516a785) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-09oeqa/selftest: add test for git working correctly inside pseudoRoss Burton
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 Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 46822268040a23dbb81f71fe35aee8c2663a31f6) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-04-28apt: add apt selftest to test signed package feedsFerry Toth
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. 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> (cherry picked from commit 3ec30490d09d6639eea2638cf12a323948f221cc) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-04-28selftest/lic_checksum: Add test for filename containing spacePaulo Neves
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. Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 324109f034f069ee3e91a1a705b3449911a448de) Signed-off-by: Steve Sakoman <steve@sakoman.com>
2022-04-01oeqa/selftest: generalise test_devtool_virtual_kernel_modifyRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2022-04-01oeqa/selftest/wic: use self.td instead of get_bb_var to save on bitbake callsRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>