Commit Graph

4068 Commits

Author SHA1 Message Date
Richard Purdie
191645f746 oeqa/selftest/overlayfs: Fix whitespace
My previous fix missed out whitespace with the append, fix that.

(From OE-Core rev: 393c4459851642b8b7e93ff303d6526cd5c97b22)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

    #

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 12:02:07 +00:00
Richard Purdie
08369812c1 testimage: Drop target_dumper and most of monitor_dumper
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: a24d787987dccc95fdd95b7e85bf525a1c55b285)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Richard Purdie
2ad6a0be02 oeqa/selftest/overlayfs: Don't overwrite DISTRO_FEATURES
Whilst debugging an autobuilder failure, I wondered why it was rebuilding qemu-system-native
instead of reusing from sstate. The reason was it was overwriting DISTRO_FEATURES,
in this case removing opengl which caused much to rebuild.

The test doesn't need that so don't do it.

(From OE-Core rev: fdcc011608fd9558a081d0ace3eaf7192d9fcaef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Richard Purdie
98b63ecc43 qemurunner: Improve handling of serial port output blocking
Similar to stdout in the previous commit, we need to ensure serial output
if written is read and put somewhere, else qemu might block on writes to
the serial port leading to hangs in the kernel. Use our existing logging
thread to log data when run_serial is not in use.

(From OE-Core rev: 05761282ba31e4ba3594f7321e2162d01fe12a5f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Richard Purdie
d921da782a qemurunner: Improve stdout logging handling
We need to ensure we read from and log the output from qemu stdout
as otherwise the buffers can fill and block, leading qemu to hang.
Use our existing logging thread to do this.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
(From OE-Core rev: a9c46ee014ef1e6436b39fdd4fd15d15388ea795)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Tim Orling
7d881f0214 oeqa: add "maturin develop" SDK test case
'maturin develop' first checks that a virtual environment
has been created, which is a good test for our python3 SDK
environment ;)

Source for guessing-game lifted from https://www.maturin.rs/tutorial

The test case is expected to fetch any necessary crates, build a
development version of the crate and package it as a wheel

Needs at a minimum the following in e.g. local.conf:
TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin"
SDK_INCLUDE_TOOLCHAIN = '1'
SDK_TOOLCHAIN_LANGS += 'rust'

The output of 'maturin develop' should be something like:
...
🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8
🐍 Not using a specific python interpreter
📡 Using build options features from pyproject.toml
   ...
   Compiling guessing-game v0.1.0 (/path/to/guessing-game)
    Finished dev [unoptimized + debuginfo] target(s) in 7.14s
📦 Built wheel for abi3 Python ≥ 3.8 to /path/to/tmpdir/guessing_game-0.1.0-cp38-abi3-linux_x86_64.whl
🛠 Installed guessing-game-0.1.0

(From OE-Core rev: 5265dd0b102cd7f3c6bb2ae1b18e9f625b834b39)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:07:22 +00:00
Tim Orling
b2b2e02775 oeqa: add simple 'maturin' SDK (testsdk) test case
We expect 'maturin' will be used in SDKs, so it makes sense to also
test it in the testsdk environment.

To run this test case, you can add the following to local.conf:
TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin"

And then build and test the SDK:
bitbake -c populate_sdk core-image-full-cmdline
bitbake -c testsdk core-image-full-cmdline

You can substitute a different image recipe for "core-image-full-cmdline"

(From OE-Core rev: 7ceff48625d01a0e60eb761a9a668d0c942cda89)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:07:22 +00:00
Tim Orling
844e91049c oe-selfest: add maturn runtime (testimage) test
Basic smoke test for maturin to test the 'maturin list-python' case.

(From OE-Core rev: 47c948c3cf6e582abd12021ceeff2c20a3e81fb5)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:07:22 +00:00
Tim Orling
9707dc5549 recipetool: add python_maturin support
Add the new python_maturin PEP-517 backend

Add selftest for 'pydantic-core' pypi package.

(From OE-Core rev: 69b679380616a94a631681caa05d9bf7610f9372)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:07:21 +00:00
Alexander Kanavin
6e6bb93fda oeqa/selftest/sstatetests: re-work CDN tests, add local cache tests
With the rework of printdiff, it is not longer useful for checking
absence of sstate objects in a remote http cache, as it would only
report the top level missing signatures, and leave the recursive
investigation to diffsigs (which relies on ability to list cache
files - not available over http).

The CDN check can be performed by simply running 'bitbake -DD -n'
which is very verbose, but neverthless reports the amount
of missing sstate objects and what they are in a way that can
be programmatically extracted and checked (as suggested by RP).

This also adds local sstate tests, as they can be useful to
determine whether the missing cdn objects were never created or
erroneously cleaned up, or if they were created but didn't propagate
to cdn.

[YOCTO #15303]

(From OE-Core rev: 2a7c653a2eee85e5791a8fdc15857367f0ed0bd9)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:07:21 +00:00
Richard Purdie
26edf89561 oeqa/sstatetests: Disable gcc source printdiff test for now
There are some issues with the printdiff code this has identified, disable the
test for now until we have patches to resolve them.

(From OE-Core rev: 436766983568a8bddc4b9ffa28dc656bf4bf67c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-16 13:12:42 +00:00
Adrian Freihofer
85f84b4090 oe-selftest: add tests for C and C++ build tools
Add new file for C and C++ build tools. The initial implemmentation
contains a class for CMake and one for Meson. At least these first
tests for the qemu-usermode share most of the code. That's why there
is only one c_ccp.py file and not for example a cmake.py and a
meson.py file.

(From OE-Core rev: 41390f5202a6ee7472cb82d12c7c32f89d6e52ff)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:58:15 +00:00
Adrian Freihofer
1ec91141e5 oeqa/core/decorator: add skip if not qemu-usermode
Add a decorator to skip tests which require the qemu-usermode machine
feature.

(From OE-Core rev: 3d79615d6c9ccb1ff3766ce05389bc22cbd656e1)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:58:15 +00:00
Yash Shinde
7a20381430 rust: Disable rust oe-selftest
After rust is upgraded to 1.71 and later versions, the rust oe-selftest gives
build errors due to unstable nightly options(see the error mentioned below). Thus, disable the test suite
until the issue is fixed

error: the option `Z` is only accepted on the nightly compiler
thread 'main' panicked at 'failed to gather the target spec for x86_64-poky-linux-gnu', synthetic_targets.rs:66:9

Following issues are created in Yocto bugzilla and rust upstream to track this issue-

https://bugzilla.yoctoproject.org/show_bug.cgi?id=15275
https://github.com/rust-lang/rust/issues/115642
https://users.rust-lang.org/t/does-rust-test-suite-supports-nightly-options-during-bootstrapping-in-rust/103108
https://users.rust-lang.org/t/unable-to-read-target-specs-when-rust-1-73-is-bootstrapped-in-yocto-poky/102959

(From OE-Core rev: fa2d3cda8f7f932c0ed5c534c4bc820af2761cd5)

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:49:42 +00:00
Julien Stephan
5d6a41b265 oeqa/selftest/recipetool: fix metadata corruption on meta layer
[YOCTO #15314]

test_recipetool_appendsrcfile_update_recipe_basic is using base-files as
test recipe but modifies it directly which can corrupt metadata for other
tests relying on this recipe.

So use mtd-utils-selftest as test recipe from meta-selftest to avoid
this kind of issues

(From OE-Core rev: bf5e6c1b6ceca5a2eda30359d5e5e330278a97e1)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:34:27 +00:00
Julien Stephan
94c4d9e35f oeqa/selftest/recipetool: remove left over from development
Remove leftover code needed for development that was unintentionally
committed

(From OE-Core rev: b9a11e6495a27164d095673915edddb2474fdbd7)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:34:27 +00:00
Julien Stephan
f32178a246 oeqa/selftest/recipetool: add back checksum checks on pypi tests
recipetool pypi plugin was originally clobbering SRC_URI checksums.

Now it doesn't do this anymore:
78ef0313ee - recipetool: pypi: do not clobber SRC_URI checksums
so add back the checksum checks on pypi tests.

Also this commit restrict the checksums:
45d2f8d4bc - recipetool: create: Only include the expected SRC_URI checksums
so add only the needed ones.

(From OE-Core rev: 86164f770032bb66d4497c4e3e7591b7246ac2d9)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:34:27 +00:00
Ross Burton
b9eeb3b386 qemurunner: remove unused import
Removes unused logging import

(From OE-Core rev: 1f21509a2fadb66888589e9946b34dddf5becc72)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:34:27 +00:00
Richard Purdie
4bb222e0d7 useradd: Fix useradd do_populate_sysroot dependency bug
If a task is adde which has a dependency on the do_populate_sysroot task of
the recipe, it will cause it to be installed into the sysroot (similar to
do_addto_recipe_sysroot). This fails since the postinst script is an overlapping
file:

Exception: FileExistsError: [Errno 17] File exists:
'tmp/sysroots-components/all/useraddbadtask/usr/bin/postinst-useradd-useraddbadtask'
  ->
'tmp/work/all-poky-linux/useraddbadtask/1.0/recipe-sysroot/usr/bin/postinst-useradd-useraddbadtask'

The copy written out at do_prepare_recipe_sysroot time is just for debug so
rename it, meaning there are no longer overlapping files and the installation
can be successful, removing the error.

[YCOTO #14961]

With the bug fixed, enable the test.

(From OE-Core rev: 564339afb73fc52a66c1a08437587cad1c4d46e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-10 09:24:01 +00:00
Pavel Zhukov
61805f6d60 oeqa/selftest/bbtests: Add test for unexpanded variables in the dirname
Regression test for [Yocto #15255]

(From OE-Core rev: 4c31cc114f2cf13c11b7ffd60db0eda1b63cc27b)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alexander Kanavin
95c187e54e sstatesig/find_siginfo: special-case gcc-source when looking in sstate caches
This is already done for local stamps just above, and will allow enabling
the full selftest that compares gcc-source signatures via printdiff
(that is, both local stamp and sstate variants).

(From OE-Core rev: 29775b5ecfc8d811293962f050fcfc3b3ad7efde)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alexander Kanavin
3befa37ae7 selftest/sstatetests: do not delete custom $TMPDIRs under build-st when testing printdiff
If the tests fail, these contain useful artefacts, and so should
be kept. If the test succeeds the whole build-st/ is deleted.

Also, give them unique names, as otherwise the tests would
step on each other.

(From OE-Core rev: 92e33a19fbcc6c59199fcd8b17ad8ca29ebcd4fd)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Alexander Kanavin
97a7fe536d selftest/sstatetest: print output from bitbake with actual newlines, not \n
Assert*() functions from python unittest would join the multiline output with \n, making it
almost unreadable.

(From OE-Core rev: 1b01a71e77f70af77887c27be21265ac61f2c9a7)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Eilís 'pidge' Ní Fhlannagáin
e70f491b7e usergrouptests.py: Add test for switching between static-ids
This test is related to https://bugzilla.yoctoproject.org/show_bug.cgi?id=12107

At the moment it doesn't seem to be able to actually replicate this
issue in the bug, which tells me it's likely fixed.

(From OE-Core rev: 2b3fa9981252d41d3f23592715657fe810f834ad)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:51:10 +00:00
Eilís 'pidge' Ní Fhlannagáin
e3ce7ce215 useradd: Add testcase for bugzilla issue (currently disabled)
Add a disabled a test for 14961 - addtask between do_populate_sysroot and do_package breaks useradd class.
A fix is still needed for this.

(From OE-Core rev: b6af5788f7f8fb1e9d8ad14bd12168ff9d6baa21)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:51:10 +00:00
Eilís 'pidge' Ní Fhlannagáin
ecef665062 useradd: Fix issues with useradd dependencies
If recipe A requires the useradd actions of recipe B we need to
ensure that recipe B is part of the recipe A dependancy chain. In
order to do that, we introduce USERADD_DEPENDS. This makes sure
that the do_populate_sysroot_setscene of recipe B exists for
recipe A in case of a missing TMPDIR. This requires changes made in
runqueue.py by RP.

This commit along with the runqueue fixes effects:
Bug 13419 - recipes that add users to groups cannot rely on other recipes creating those groups (when population from sstate happens)
Bug 13904 - do_prepare_recipe_sysroot: postinst-useradd-* does not run in order of dependency and sometimes fails
Bug 13279 - Make sure users/groups exist for package_write_* tasks
Bug 15084 - For some reason using of same user in two recipes does not work properly

I've included the start of self-testing for useradd by adding tests for
13419 (which ends up testing 13904, 13279, 15084 by virtue of them all
      having the same root cause)

(From OE-Core rev: b47f2352376bd16b7e7087b4dab143403e67e094)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:51:10 +00:00
Richard Purdie
1b14962c3f oeqa/runtime/systemd: Ensure test runs only on systemd images
When enabled in DISTRO_FEATURES the test may run on a system without systemd.
Fix this.

(From OE-Core rev: c2b473390dec0f5132d5b4bff6d3c35214eb898b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:09:59 +00:00
Alexandre Belloni
e1931b5e0e oeqa/selftest/recipetool: stop looking for md5sum
The md5sum is no longer generated by recipetool, stop expecting it.

(From OE-Core rev: d9b5f6a2eefa68fcecfca20b293d593f5cd53b7c)

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
dd2fb8f00a devtool: upgrade: Update all existing checksums for the SRC_URI
In addition to updating the sha256sum and removing the md5sum, update
all other existing checksums. If the only existing checksum is md5sum,
then replace it with the default expected checksums (currently only
sha256sum).

(From OE-Core rev: 8ea8827ee49b7f0443b1c4bd47d1344a689d73a3)

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>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
45d2f8d4bc recipetool: create: Only include the expected SRC_URI checksums
Rather than including all SRC_URI checksums, include the ones that are
expected. These are the same as are output if no checksums are included
when building the recipe.

(From OE-Core rev: c2af83eb5e8573480179b6c0bcce50606b547099)

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>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
3ef9ea88f1 lib/oe/recipeutils: Avoid wrapping any SRC_URI[sha*sum] variables
Before, a variable such as SRC_URI[sha512sum] would end up as:

SRC_URI[sha512sum] = "45ff3abce4dab24a8090409e6d7bb26afa7fa7812a51e067 \
28c2aa47d5b4de610d97ba4609cf13d9173087bd909fdf377235eee988a6fdcf52abb7 \
0341c40b5b"

when updated by patch_recipe_lines().

(From OE-Core rev: a67e2feed1420739504d2a59d018dff7e6e17e04)

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>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
7481f8e916 oeqa/selftest/recipetool: Make test_recipetool_load_plugin more resilient
* Avoid trying to write to read-only directories and file systems.
* Support symbolic links in BBPATH.

(From OE-Core rev: 9a8b621c4d26ff349de88658e6ea21aee6ba6767)

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>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
99bc21953a oeqa/selftest/devtool: Make test_devtool_load_plugin more resilient
* Avoid trying to write to read-only directories and file systems.
* Support symbolic links in BBPATH.

(From OE-Core rev: eba30ce546cda0ae4c3e433b6e79dbab0627157a)

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>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
389ef0d9e4 oeqa/selftest/devtool: Avoid global Git hooks when amending a patch
To avoid potential problems due to global Git hooks, add --no-verify to
a `git commit --amend` command.

(From OE-Core rev: 802359c0ec6db0b3a4103f8ad8bc9bed67884555)

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>
2023-12-08 16:58:34 +00:00
Peter Kjellerstedt
331f78ecc2 oeqa/selftest/devtool: Correct git clone of local repository
If the build environment is setup using `repo`, then poky/.git/object
is a symbolic link rather than a directory. To clone such repositories,
the source path must be prefixed with "file://". This avoids the
following error:

  fatal: failed to start iterator over '.../poky/.git/objects': Not a directory

(From OE-Core rev: 8e3d08cb9274832a346ac3dffa8c9d5f6e93c478)

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>
2023-12-08 16:58:34 +00:00
Etienne Cordonnier
959b1f7de4 gdb/systemd: enable minidebuginfo support conditionally
Enabling minidebuginfo is not useful if gdb and systemd-coredump
are unable to parse it.

In order to parse it, gdb needs xz support. Systemd needs coredump enabled, as
well as elfutil enabled as well (systemd-coredump loads libdw which is part of elfutils using dlopen).

(From OE-Core rev: 0d2df803bebfd7e832ab7da54c4dacaaeeb424a9)

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:50 +00:00
Julien Stephan
ec340f14da oeqa/selftest/recipetool: appendsrc: add test for update mode
add a basic test for testing the update mode of recipetool
appendsrcfile(s)

(From OE-Core rev: f999092c772f10d23106c355e2787259befb6e30)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:50 +00:00
Julien Stephan
7ff486d556 oeqa/selftest/recipetool: appendsrfile: add test for machine
Add a new test for machine specific bbappend override

(From OE-Core rev: 1c510a21487fa71e88eb46e9a0de00a82a7ba4e4)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:50 +00:00
Julien Stephan
0ae9cf2373 recipeutils: bbappend_recipe: allow to patch the recipe itself
Add a new parameter update_original_recipe to allow to patch a recipe
instead of creating/updating a bbappend

(From OE-Core rev: 2f68ab2464bfad1b377df44a7b51203df59d66ce)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
29dc0d7315 recipetool: appendsrcfile(s): use params instead of extraline
appendsrc function relies on oe.recipeutils.bbappend_recipe to
copy files and add the corresponding entries in SRC_URI.

Currently, appendsrc function build itself the new SRC_URI entry to add the
correct subdir param, and gives it using the extralines parameter.
This has 2 drawbacks:
- oe.recipeutils.bbappend_recipe can already do this if we specify the
  correct params, so we have duplicate code
- the duplicated code is not fully functional: for example, it doesn't
  take into account the -m/--machine parameter

So fix this by not using extralines but give correctly formatted params.

Also remove the check for already existing entries as
oe.recipeutils.bbappend_recipe already implement it

The new bbappend file now have the SRC_URI entry after the
FILESEXTRAPATHS so fix the selftest.

Update test_recipetool_appendsrcfile_existing_in_src_uri_diff_params
test because recipetool appendsrcfiles used to not add new src_uri entry
if the entry already exist even with different parameters while
oe.recipeutils.bbappend_recipe adds it if parameters are different (and
remove the old entry)

(From OE-Core rev: cd5de8d53849a6f3bb6f82e45fb301e39892c789)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
165626f7b9 recipeutils: bbappend_recipe: remove old srcuri entry if parameters are different
Currently we do not add a new src_ury entry if the entry already exists
AND the parameters are the same.

I believe that when an entry already exist with different parameters,
we should remove it and add the new entry otherwise we end up with two
entries with different parameters

(From OE-Core rev: a4628fffcfecb5cd95dc2558dfd39ebd71121eab)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
11d4d437d5 recipeutils: bbappend_recipe: add a way to specify the name of the file to add
bbappend_recipe can take a dict of source files to add to SRC_URI where
the key is the full path to the file to be added and the value is a dict

Add a new optionnal entry "newname" to specify the name of the newly added file

(From OE-Core rev: e7bc09e5c9d7a0f4f8f4eba40730b68857b00677)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
b45cab4e1c recipeutils: bbappend_recipe: fix docstring
Add missing patchdir key in docstring description for srcfiles
parameters.

Also fix typo: value --> key in srcfile docstring description

(From OE-Core rev: 302dccaef46418d0e0731870a882b54a525739ed)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
eb0b664c8c recipeutils: bbappend_recipe: fix undefined variable
In the case get_bbappend_path returns None (could not find the layer
containing the recipe) the error message tries to print the recipefile,
but it is not defined. Fix it.

(From OE-Core rev: 234111fb67ffbcc5492cb0cd96db25ed8f5acea0)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Yoann Congal
2c59f5ad01 lib/oe/patch: handle creating patches for CRLF sources
Using devtool to patch CRLF based sources creates patch files which have
mixed end of lines : LF for headers and CRLF for source context and
modified lines.

Python open(..., newline=None) (default for newline arg)does detect
end-of-line in this mixed file but only outputs LF EOL data. This
result in patch files that does not apply on the original sources.

Switching to open(..., newline='') allows to detect end-of-line but keep
the original end-of-line intact. This generate correct patches for CRLF
based sources.

Fixes [YOCTO #15285]

(From OE-Core rev: 58f845499c0277a2b8069eefa235430b5f5f7661)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Ross Burton
9406c0d28f oeqa/runtime/parselogs: migrate ignores
Move the ignores from a huge dict in the parselogs.py module to .txt
files. This is just the common, tune, and qemu machine ignores; the
machine ignores that are not in oe-core will be added to the relevant
layers.

The list of ignores has not been reviewed in any meaningful way, this
should be done soon as I suspect a number of these are redundant.

(From OE-Core rev: bba243e1d18b954578afcdb3c727d8f687187ee8)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Ross Burton
41ffa16912 oeqa/runtime/parselogs: load ignores from disk
Instead of hardcoding the list of ignored errors/warnings in the test
itself, read them plain text files on disk.

This uses importlib to try to open a file called
oeqa.runtime.cases.parselogs-ignores-[candidate].txt, where the
candidate will be:

- "common"
- The TARGET_ARCH
- Each of the MACHINEOVERRDES

This allows the common and tune-specific ignores to be retained in
oe-core, and machine-specific ignores added to the layer where the
machine is defined.

[ YOCTO #14604 ]

(From OE-Core rev: 7a04063f7cff243fe2bee09664ad7979612110cb)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Lukas Funke
2da0213eee selftest: wic: add test for zerorize option of empty plugin
Add test for empty plugin which tests whether the plugin creates
partitions with actual data which is 'zero'.

(From OE-Core rev: 6c6b236b34b35d0e2c020e0f9c447ac35adf8faf)

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
a02279663f oeqa/selftest/recipetool/devtool: add test for pypi class
recipetool now supports the pypi class and python recipes can by created
using the new following syntax:

* recipetool create https://pypi.org/project/<package>
* recipetool create https://pypi.org/project/<package>/<version>
* recipetool create https://pypi.org/project/<package> --version <version>

or the old syntax:
* recipetool create https://files.pythonhosted.org/packages/<...>

So add tests for the new syntax and modify old tests

(From OE-Core rev: 50779b7d45a492e9564005274f1858234a871e10)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00
Julien Stephan
9f4df13f64 oeqa/selftest/recipetool: remove spaces on empty lines
(From OE-Core rev: 365c3fd9def03e07af025a949e27c4f324fd6094)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:49 +00:00