Commit Graph

3744 Commits

Author SHA1 Message Date
Richard Purdie
6570fd5116 oeqa/sdk/assimp: Upgrade and fix for gcc 14
To enable this test to work with gcc 14, pass the option to make
warnings non-fatal. Also upgrade to version 5.4.1 from 5.3.1.

(From OE-Core rev: c0c58c9acbcbed26f95864dc5e40b5995252ce4a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c3df6287ae26dc9d7f11eb7e26fdbcaefe4dfead)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-20 06:29:43 -07:00
Ross Burton
b2286f9882 oeqa/sdkext/devtool: replace use of librdfa
librdfa hasn't had a commit for a decade now and as such has problems
with modern compilers (specifically gcc 14.1).  Switch the recipe
creation test to something much simpler that we also control: dbus-wait.

(From OE-Core rev: 311e7b5b9ee4f0d96a376a06f01c5bfd379ca244)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d801de1f702d8d0def55011b5b6ad39d85f978f1)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-20 06:29:43 -07:00
Alexandre Truong
554e8de6a4 Revert "oeqa/selftest/devtool: fix test_devtool_add_git_style2"
This reverts commit ab6d3e3d64
from poky repository.

The previous reverted commit was a workaround. The fix
"oeqa/selftest/devtool: fix _test_devtool_add_git_url"
tackle the issue. So, the workaround is not needed anymore.

(From OE-Core rev: fd30cc2ab99fe6a8e4beb29d9cb46a772db8b8d8)

Signed-off-by: Alexandre Truong <alexandre.truong@smile.fr>
Reviewed-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>
(cherry picked from commit 731f47ecfd8ad6558aac629806810789c623986b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-19 08:34:58 -07:00
Alexandre Truong
afba27a984 oeqa/selftest/devtool: fix _test_devtool_add_git_url
This patch is a follow-up to the bug#15466.

As a reminder, the bug was about devtool’s submodule detection
checking for HEAD when a version is being passed.

As Vincent Kriek pointed out:
the --version that is being passed to devtool is only used for
setting the PV value in the recipe. To take into account the tag,
we add --srcrev to the command:
devtool add --srcrev v3.1.0 --version v3.1.0 mbedtls git://git@github.com/ARMmbed/mbedtls.git;protocol=https

Changes to _test_devtool_add_git_url have been made to take
into account the srcrev. srcrev will be passed as an optional
parameter because the test_devtool_add_git_style1
does not need the srcrev contrary to test_devtool_add_git_style2

Fixes [YOCTO #15466]

(From OE-Core rev: c297b78454da2a668e62dec95d7b6eb6e5429480)

Signed-off-by: Alexandre Truong <alexandre.truong@smile.fr>
Reported-by: Alexandre Truong <alexandre.truong@smile.fr>
Suggested-by: Vincent Kriek <vincent@coelebs.dev>
Reviewed-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>
(cherry picked from commit a8686f3641e4407dee3d807898ffd620e2732b78)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-19 08:34:58 -07:00
Julien Stephan
a4cd5dc1ee oeqa: selftest: context: run tests serially if testtools/subunit modules are not found
If testtools and/or subunit modules are not found we get the following backtrace
(example for testtools):

  NOTE: Starting bitbake server...
  Traceback (most recent call last):
    File "<..>/poky/scripts/oe-selftest", line 60, in
  <module>
      ret = main()
    File "<..>/poky/scripts/oe-selftest", line 47, in main
      results = args.func(logger, args)
    File "<..>/poky/meta/lib/oeqa/selftest/context.py",
  line 391, in run
      rc = self._internal_run(logger, args)
    File "<..>/poky/meta/lib/oeqa/selftest/context.py",
  line 377, in _internal_run
      rc = self.tc.runTests(**self.tc_kwargs['run'])
    File "<..>/poky/meta/lib/oeqa/selftest/context.py",
  line 161, in runTests
      return super(OESelftestTestContext, self).runTests(processes, skips)
    File "<..>/poky/meta/lib/oeqa/core/context.py", line
  91, in runTests
      result = self.runner.run(self.prepareSuite(self.suites, processes))
    File "<..>/poky/meta/lib/oeqa/selftest/context.py",
  line 154, in prepareSuite
      from oeqa.core.utils.concurrencytest import ConcurrentTestSuite
    File
  "<..>/poky/meta/lib/oeqa/core/utils/concurrencytest.py",
  line 22, in <module>
      import testtools
  ModuleNotFoundError: No module named 'testtools'

Fix this by adding a custom callback on -j/--num-processes parameter to
check testtools and subunit modules. Fallback to serial testing if
missing. This strategy is already used in sdk/context.py

(From OE-Core rev: ffd1db7d7813f6da22c0d9ef5fde6738058f1eb2)

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 35284404473b2c2d9f69594582868ed66ef3525e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-19 08:34:58 -07:00
Khem Raj
c3235e3ae9 oeqa/postactions: Do not use -l option with df
-l option is specific to df provided by coreutils, if df
applet from busybox is used then it does not work and fails
like below

Fixes
   df: invalid option -- 'l'
   BusyBox v1.36.1 () multi-call binary.

   Usage: df [-PkmhT] [-t TYPE] [FILESYSTEM]...
   DEBUG: [Command returned '1' after 0.71 seconds]
   DEBUG: Command: df -hl
   Status: 1 Output:  df: invalid option -- 'l'

it seems worth a compromise to show remote mounted filesystems if any
during ptests and it works with both df implementations

(From OE-Core rev: 82a0df6cc2c5b18cb48fd8c3be26a11f4016d98d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 75cc1ea4348a2294fdc5ab20530fcff27056ff06)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-19 08:34:58 -07:00
Ola x Nilsson
5ff13f1b01 oeqa/selftest/devtool: add test for modifying recipes using go.bbclass
go.bbclass uses a special do_unpack function that causes the git root
to be different from S.  Verify that it unpacks as expected.

[ YOCTO #15483 ]

(From OE-Core rev: 71adf7c18215faf73454be79d7b51f2a0c338c0f)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit fab0c737b95b8d0c0bbf58336bc308776c956406)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-19 08:34:58 -07:00
Philip Lorenz
d37ef8925a ipk: Fix clean up of extracted IPK payload
It turns out that the IPK payload tarball was actually cleaned up in the
concrete package manager implementation (most likely because at some
point Debian and IPK packages used different compression algorithms).

Globbing removes this ambiguity so move the removal of the payload into
the common extract method.

(From OE-Core rev: ec1c6bc79f5ca219e77a379bbabc2dad808d2020)

Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1e2b02a54f482159e21902eeb997b21e00e9588e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-05 05:57:12 -07:00
Philip Lorenz
fb4eb8a09d lib/package_manager/ipk: Do not hardcode payload compression algorithm
The chosen payload compression algorithm can be changed by overriding
`OPKGBUILDCMD`. Ensure that package extraction deals with this by
globbing for "data.tar.*" to select the actual payload tarball.

(From OE-Core rev: c2b00cd4148d4b08ba5673488a652f8daf3ac085)

Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2ad05635a6da403b4fadcc126fe7734067c12c73)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-05 05:57:12 -07:00
Julien Stephan
a905386e10 oeqa/selftest/devtool: add test for updating local files into another layer
We don't have a test to check if we can correctly devtool update-recipe/finish
into another layer. So update the existing test_devtool_update_recipe_local_files
to also check the updates into another layer.

(From OE-Core rev: bd44c895d36e246a25c7a6e40bf9f4089dc7a297)

(From OE-Core rev: 0532a6292edbe68303b6d85017ebcdb36a60886f)

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>
Signed-off-by: Jeff Harris <jefftharris@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-06-05 05:57:12 -07:00
Ross Burton
68f9a4b73d oeqa/selftest/debuginfod: use localpkgfeed to speed server startup
Sometimes the debuginfod selftest fails due to a timeout, because it
spends too long scanning a huge deploy directory that due to what tests
were ran previously can contain 30K packages.

The test only needs a subset of the feed, so use the new localpkgfeed
class to construct a minimal feed before running the test.

[ YOCTO #14937 ]

(From OE-Core rev: 0795169be206f1d4d140fe378e2476a44d0ce02b)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 855376f518b28248ccd82ef5b2e89e6a8c970542)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-05-23 08:55:01 -07:00
Ross Burton
0fe72b1a67 lib/oe/package-manager: allow including self in create_packages_dir
This function is typically used to construct a limited feed for image
creation, but there are other cases when you might want a limited feed
and include the current recipe's packages in it.

To ensure that existing behaviour is preserved, add a boolean to control
this behaviour and default it to False.

(From OE-Core rev: 20a6f55328733ad6f0c05b1353e8d525019aeea7)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit aada7fda2b118152d82b1ab295d92b8251afe4ac)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-05-23 08:55:01 -07:00
Trevor Gamblin
2e084b7b80 patchtest: test_metadata: fix invalid escape sequences
Clear up the following warnings seen during patchtest runs:

|/workspace/yocto/poky/meta/lib/patchtest/tests/test_metadata.py:21: SyntaxWarning: invalid escape sequence '\+'
|  add_mark = pyparsing.Regex('\+ ')
|/workspace/yocto/poky/meta/lib/patchtest/tests/test_metadata.py:26: SyntaxWarning: invalid escape sequence '\:'
|  git_regex = pyparsing.Regex('^git\:\/\/.*')

(From OE-Core rev: b5406d3691341c050a62fc9a32dc5573fd0c484f)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 2d64317835a768898aac592b24fcbdfaf6c8357a)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2024-05-23 08:55:01 -07:00
Jose Quaresma
110ee701b3 sstatesig: fix netrc.NetrcParseError exception
Looks like sometimes the e.filename and the e.lineno is not properly set by the netrc
and this can cause TypeError.

| File "/poky/meta/lib/oe/sstatesig.py", line 342, in init_rundepcheck
|     bb.warn("Error parsing %s:%d: %s" % (e.filename, e.lineno, e.msg))
|             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| TypeError: %d format: a real number is required, not NoneType

(From OE-Core rev: 486ed69939f1b7572f121960c2dde246032686e7)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04 21:50:24 +01:00
Alexandre Truong
ab6d3e3d64 oeqa/selftest/devtool: fix test_devtool_add_git_style2
The problem is the following:
AssertionError: 'gitsm://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master' != 'git://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master'

Mbedlts made changes to their repository, adding a sub-module, thus the
assert triggers an error with the url:
git://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master

456a54da8e
was the upstream change.

To fix the issue, the url has been changed to:
gitsm://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master

(From OE-Core rev: 9ac737fbe05c85ec8333b396ce2f89de6654916f)

Signed-off-by: Alexandre Truong <alexandre.truong@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04 21:50:24 +01:00
Baruch Siach
0c9d83138e oeqa/selftest/overlayfs: test read-only rootfs
Use the read-only squashfs filesystem to test the read-only case.

(From OE-Core rev: 1a61da196f014dc34a998d3e46f03abc79ebc84d)

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04 14:05:03 +01:00
Richard Purdie
30d88a2043 oeqa/sstatetests: Fix race issue
Under some load conditions, the result event can come back before the
command complete event. If that happens, the code would hang
indefinitely.

Rework the code to wait for both events and avoid the hang.

(From OE-Core rev: 8cfc94a4404c54bc73eab9f98d9da1f84c2135ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-31 06:57:01 +01:00
lixiaoyong
66f2f710e6 oe/package: enhance objdump command call with llvm
Replace `${HOST_PREFIX}objdump` with `${OBJDUMP}`.

When utilizing llvm for compiling packages, the invocation of GNU objdump
will consistently occur during package precess. This behavior is unfriendly
to llvm. So prefer `${OBJDUMP}` over `${HOST_PREFIX}objdump`.

(From OE-Core rev: fac4d33041d8feb041e617b9b16689c4d3a522cb)

Signed-off-by: lixiaoyong <lixiaoyong19@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-30 22:25:43 +00:00
Jermain Horsman
9b839a835c bblayers/makesetup.py: Move git utility functions to oe.buildcfg module
This allows other classes to make use of these as well.

Includes a git describe and git toplevel function and functions
to get info for git remotes.

(From OE-Core rev: a04a084b6e513d15cb57ee103c6d6215ce1c75b9)

Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-30 22:25:43 +00:00
Alexander Kanavin
d1622b87f8 selftest/sstatetests: run CDN check twice, ignoring errors the first time
The current CDN isn't able to serve all objects on first request, and it
was suggested to work around that by trying again:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15335#c16

Once CDN moves to a better location this can probably be reverted.

[YOCTO #15335]

(From OE-Core rev: 0db3466303f56736d2fa9a105435eaaadb385082)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-30 22:22:19 +00:00
Joshua Watt
df60c6d3ee sstatesig: Warn on bad .netrc
If there is an error parsing .netrc, warn the user

(From OE-Core rev: 47ea9418dfa31a87bc0014c482be5bfdc9df98e1)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-26 17:10:51 +00:00
Joshua Watt
84cb5d2568 sstatesig: Set hash server credentials from bitbake variables
Allows the hash server credentials to be specified in bitbake variables.
If omitted, the users .netrc will be checked

(From OE-Core rev: ba391d39f2b888706e53028e9df3a37c5baedfc1)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-23 10:18:20 +00:00
Eilís 'pidge' Ní Fhlannagáin
2b5903f511 sstatetests.py: Add testing for correct sstate permissions
This patch adds to run_test_sstate_creation so that it also tests
that sstate directories don't accidentally pickup umask permissions
from the user upon creation.

[RP: Python style tweaking]
(From OE-Core rev: 7d6eb828e97ad3f27d94efdccd920fb2aef36743)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Richard Purdie
0bd3234676 oeqa/runtime/login: Fix dbus-wait timeout and loop conditional
The dbus-wait command returns a timeout after 60s but reports "success", detect this.
Unfortunately it does effectively break the test as the signal is nearly never being
correctly detected since it was already sent.

For that reason comment out the code instead too.

Also fix the loop conditional as the logic was incorrect and it was looping
indefinitely when an image match didn't occur.

(From OE-Core rev: 89c930e9e4b38b116edcba59e88621a39f8bda67)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Eilís 'pidge' Ní Fhlannagáin
f6235fef62 oeqa/runtime/login: Add screenshot sample logic/timeout/dbus-wait
This patch uses dbus-wait to wait for matchbox to be up. Once that
happens, it sets a timeout of 60 seconds and takes a screenshot
and compares it, every 2 seconds. If diff=0 it passes. If the timeout
ends, it fails.

(From OE-Core rev: 287b4f0a8244f7214f6a1aaa84ef16cc528f8326)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Eilís 'pidge' Ní Fhlannagáin
59c7b5e706 oeqa/runtime/login: Exclude qemuriscv64
Excluding riscv64 due to mouse rather than a touchscreen which adds a
moving cursor, so the diff ends up > 0. Need to fix the image to use the
touchscreen rather than mouse input.

(From OE-Core rev: 7f7032c7613abd62ce510c98211c75fc7c5e7090)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Richard Purdie
96af410e8e oeqa/runtime/login: Mask out the mouse panel icon for now
The mouse panel icon can move when the time changes between 3 and 4 digits.
Ideally we'd fix the alignment of the clock on the panel but to get the
tests working, increase the size of the mask for now.

(From OE-Core rev: 8ec02142ab98741749281bdb29d5973c96b839d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Richard Purdie
4d161405d5 oeqa/runtime/login: Various code improvements and fixes
* Allow tools to be found from the host PATH so that imagemagick from a buildtools
  tarball/sdk can work
* Reformat the code to have imports at the start of the file and have more standard
  formatting and whitespace
* Always save copies of the images, the space imapct is negligle compared to the
  debug win
* Write the images to ${T}
* Use bb.utils.mkdirhier() instead of more complex code
* Restrict the tests to images containing matchbox-desktop

(From OE-Core rev: d09989b49517830297654e4d1d150aaa8723c41a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Eilís 'pidge' Ní Fhlannagáin
b49d42ce90 oeqa/runtime/login: Proof of concept for screenshot testcases
This takes the work rburton did on image screenshot testing and
expands it.

Right now this works with most of the qemu based machines except for

- qemuppc64
- qemuarmv5
- qemuriscv32
- qemuloongarch64

See "Known Issues" further down.

This test takes a screendump of a qemu image, blanks out the clock
and compares it to an image we have on record. If the diff is exact,
the test passes. If not, it stores the image in build/failed-images and
fails out.

In order to enable this test, you will need meta-openembedded/meta-oe in
your bblayers.conf for imagemagick and the following in local.conf:

IMAGE_CLASSES += "testimage"
TEST_SUITES = "login"
TESTIMAGEDEPENDS:append:qemuall = " imagemagick-native:do_populate_sysroot "

Known Issues
------------

The main issue is that I've yet to find a gating factor that would allow
me to tell when the qemu instance is fully up and rendered. I've tried a
few tactics here, (dbus-wait, qmp) but for now a disgusting
time.sleep(30) is there.

You can replicate this by running qemumips. The screen load takes forever,
but you even see it on qemux86 where the Home and Workspace Switch icons
will sometimes take a while to fully load.

Eventually I'm going to have to take multiple screenshots and compare
them, but then you get into the issue where the question is, is the diff
greater than 0 because it hasn't fully loaded or something is actually
incorrect.

There are the issues I know about:

   - runqemu qemuppc64 comes up blank.
   - qemuarmv5 comes up with multiple heads but sending "head" to screendump.
     seems to create a png with a bad header.
   - qemuriscv32 and qemuloongarch64 don't work with testimage apparently?
   - qemumips64 is missing mouse icon.
   - qemumips takes forever to render and is missing mouse icon.
   - qemuarm and qemuppc return incorrect width
   - All images have home and screen flipper icons not always rendered fully at first.
     The sleep seems to help this out some, depending on machine load.

(From OE-Core rev: dc7cefbaccde50df6c4396e66d50659a45e00631)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Co-authored-by: Ross Burton <ross.burton@arm.com>
Co-authored-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Eilís 'pidge' Ní Fhlannagáin
b9e9693cb0 qemurunner.py: Fix error on calls to run_monitor
A change in QEMUMonitorProtocol.cmd() requires that we either pass in
kwargs instead of an argument dict or move to cmd_raw()

cmd() was renamed to cmd_raw() (and command() was renamed to cmd())
See:
37274707f6
684750ab4f

My concern with this patch is that I haven't seen this come up with
utils/dump.py which also uses QemuMonitor's run_monitor. If it is
occuring, this should fix issues there as well

(From OE-Core rev: 9665d38ab60c1c3b27887c2b1a6396f13a1b33ea)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:27:51 +00:00
Alexander Kanavin
d339047b83 minicom: upgrade 2.8 -> 2.9
Adjust selftest to git-add the directory with newly added patches,
as the new minicom recipe has no default patches, and thus no directory
with them (and the selftest assumed it does).

(From OE-Core rev: 1fb2aa3f242ef20f8edfb518164b629258a04dd4)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 17:25:02 +00:00
Jose Quaresma
f92e32957c oeqa/gotoolchain: set GOPROXY
Since go-1.21 GOPROXY needs to be set explicitly, otherwise it fails with:
- GOPROXY list is not the empty string, but contains no entries

This fixes the selftest

(From OE-Core rev: c491d967858c01fead21495f44f1a9f8cdf8e833)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-03 16:28:21 +00:00
Alexis Lothoré
437c0721c5 oeqa/lib/utils/postactions: fix host disk usage stats retrieval
The recently introduced postactions module  can raise, on failing ptests,
the following warning:

WARNING: core-image-ptest-glib-2.0-1.0-r0 do_testimage: Can not get host
disk usage: [Errno 2] No such file or directory: '/usr/bin/df'

The issue is likely not happening because of df absence (to be confirmed
amongst the variety of workers) but because of the wrong path. Fix it by
letting subprocess search for df, passing only the binary name. To make it
work, we also have to reset the environment, otherwise the environment
configured before running bitbake will be used, and search will fail.

(From OE-Core rev: da7cc5def2839a0e15d07244f858847479c12caa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-29 10:26:13 +00:00
Adrian Freihofer
ea5a74cc67 oe-selftest devtool: ide-sdk tests
Improve the GDB related tests. Verify GDB finds the correct source
files.

(From OE-Core rev: 67eed460c0bf18d23f2c9180f195417895acfd55)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:38:46 +00:00
Alexis Lothoré
5018d3a4b6 oeqa/utils/postactions: testimage: add host disk usage stat as post action
Since the target under test can be a virtualized guest, when some tests
fail because of disk usage (see [1]), also fetch disk usage statistics from
host to allow checking whether a host disk space saturation could affect
running tests.

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15220

(From OE-Core rev: 2ab3a0935b1e7a016402f149da1fc01b38d7af55)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
d4267a8dce oeqa/utils/postactions: add target disk usage stat as post action
In order to debug issues related to disk space (see [1]),  add a failed
tests post action to retrieve disk usage on the target. Rely on the test
context object to run the corresponding command onto the target

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=15220

(From OE-Core rev: 637e216b0e5191571270aa07e1f50a6e41a8c08f)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
9a46657a25 oeqa/utils/postactions: isolate directory creation in dedicated action
In order to be able to create actions that could store new files during
failed test post actions, we need to split artifacts directory creation
from artifacts retrieval.

Create a new dedicated action to create artifacts main directory so we can
add actions creating files in this new directory, without worrying about
actions order if at least this action is set first.

(From OE-Core rev: 5d796586a9342f4f984494a5b493dbaf77af7026)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
3add7b301e testimage: create a list of failed test post actions
testimage is able to detect whenever a test run leads to some tests
failing, and execute some actions in this case. The only action currently
defined in such case is to retrieve artifacts from the target under test,
as listed in TESTIMAGE_FAILED_QA_ARTIFACTS

In order to be able to add multiple actions, define a central function to
gather all "post actions" to run whenever a test has failed
(run_failed_tests_post_actions). This function contains a table listing all
functions to be called whenever a test fails. Any function in this table
will be provided with bitbake internal data dictionary ("d") and the
current runtime testing context ("tc"). Isolate all this feature in a
dedicated postactions.py file inherited by testimage.
This patch does not bring any functional change.

(From OE-Core rev: c01aa8df0613a103859b4431d3cc5056b2fef1b8)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:35:43 +00:00
Alexis Lothoré
fec128bd62 lib/oeqa: share get_json_result_dir helper
Multiple places in oeqa need to get the log output path, and redefine a
small helper to accomplish this

Define this helper in lib/oeqa/utils/__init__.py and import it wherever
needed to allow using it.

(From OE-Core rev: 01b1a6a5a4e7cede4d23a981b5144ae9c8306274)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:35:43 +00:00
Simone Weiß
e8ea8695e1 patchtest: Skip test for CVE_CHECK_IGNORE for older branches
Skip the test for checking if CVE_CHECK_IGNORE is not used.
It is deprecated now, but was not deprecated for kirkstone and dunfell.
Skip it therefore if a patch is intended for those branches.

(From OE-Core rev: e9b04664b1b2ba6aa1fa7318e3d4174b9cdb19da)

Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24 16:10:23 +00:00
Jonathan GUILLOT
ca25926d07 lib/oe/package: fix LOCALE_PATHS scan to create locale packages
split_locales() must only check subdirectories in paths added to
LOCALE_PATHS to avoid creating weird packages based on filenames also
present in paths.

Without such a filter, cups recipe adding ${datadir}/cups/templates to
LOCALE_PATHS creates the following incorrect packages:
- cups-locale-add-class.tmpl
- cups-locale-add-printer.tmpl
- cups-locale-admin.tmpl

(From OE-Core rev: ba3aee0d516bd066829d6edaa8d7bacdd75dd6ef)

Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24 16:10:22 +00:00
Eilís 'pidge' Ní Fhlannagáin
396bc832b7 selftest-users: Convoluted selftest for USERADD_DEPENDS
This adds a test for 13904's fix by creating a convoluted set of recipes
with USERADD_DEPENDS in non-alpha order.

(From OE-Core rev: bfff81195cb9ba2493e366022470b2e0051d8071)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24 16:10:22 +00:00
Richard Purdie
4dba026177 recipetool: Fix errors with meta-poky bbappend
When a new base-files bbappend was added to meta-poky, it causes selftest
failures. Whilst this isn't ideal, workaround that issue for now since
the append is being added for security visibility and changing the tests
to support this more generically looks invasive.

(From OE-Core rev: 7cf85204f0943bf741ffce5c4105340197c714df)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-23 14:31:30 +00:00
Richard Purdie
c59d570024 oeqa/selftest/rust: Simplify the rust testsuite output gathering/processing
The rust testsuite was redirecting command output to a file, which made it
hard to debug failure cases since the logs were not available to print to
the console.

Rework the code so it uses the existing popen logging and hence allows us
to improve the error logging situation and make debugging failures easier.

(From OE-Core rev: ac82dc43b8151ed34c4ad51e9ab7f4a612990486)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-23 14:29:03 +00:00
Tim Orling
9f7475b4e5 recipetool; add support for python_mesonpy class
* Add support to detect the "mesonpy" build-backend for recipetool create.
* Add oe-selftest case for creating a recipe for "siphash24" from pypi.
  https://pypi.org/project/siphash24/

This is by far the simplest recipe using the mesonpy build backend.

Upstream does not provide LICENSE file(s) and we do not detect the
LICENSE so don't check for that result in the test. Likewise, upstream
does not define HOMEPAGE, so skip that result.

(From OE-Core rev: 256749322671d2f4ea994db671d73c4de10e1723)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 11:39:45 +00:00
Richard Purdie
0b33104a97 python: Drop ${PYTHON_PN}
python 2 is gone and we don't need the abstraction now, drop the remaining usage
of this variable.

The definition in python3-dir.bbclass is left for now for other layers.

(From OE-Core rev: b566b1e32c7993d1ab7795562f648e52ce186a70)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 11:39:45 +00:00
Peter Kjellerstedt
4cfd0f7e4e lib/oe/patch: Use git notes to store the filenames for the patches
The old way of keeping track of the filenames for the patches that
correspond to the commits was to add a special comment line to the end
of the commit message, e.g., "%% original patch: <filename>", using a
temporary git hook. This method had some drawbacks, e.g.:

* It caused problems if one wanted to push the commits upstream as the
  comment line had to be manually removed.
* The comment line would end up in patches if someone used git
  format-path rather than devtool finish to generate the patches.
* The comment line could interfere with global Git hooks used to
  validate the format of the Git commit message.
* When regenerating patches with `devtool finish --force-patch-refresh`,
  the process typically resulted in adding empty lines to the end of the
  commit messages in the updated patches.

A better way of keeping track of the patch filenames is to use Git
notes. This way the commit messages remain unaffected, but the
information is still shown when, e.g., doing `git log`. A special Git
notes space, refs/notes/devtool, is used to not intefere with the
default Git notes. It is configured to be shown in, e.g., `git log` and
to survive rewrites (i.e., `git commit --amend` and `git rebase`).

Since there is no longer any need for a temporary Git hook, the code
that manipulated the .git/hooks directory has also been removed. To
avoid potential problems due to global Git hooks, --no-verify was added
to the `git commit` command.

To not cause troubles for those who have done `devtool modify` for a
recipe with the old solution and then do `devtool finish` with the new
solution, the code will fall back to look for the old strings in the
commit message if no Git note can be found.

While not technically motivated like above, the way to keep track of
ignored commits is also changed to use Git notes to avoid having
different methods to store similar information.

(From OE-Core rev: f5e6183b9557477bef74024a587de0bfcc2b7c0d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
Peter Kjellerstedt
ff63bc403d lib/oe/patch: Add GitApplyTree.commitIgnored()
This function can be used to create a commit that devtool will ignore
when creating/updating the patches.

(From OE-Core rev: 94f0838b9223b7ece7affaa707e54a5d784da25e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
Peter Kjellerstedt
24433ce8f9 lib/oe/patch: Make extractPatches() not extract ignored commits
If a commit is marked with "%% ignore" it means it is used by devtool to
keep track of changes to the source code that are not the result of
running do_patch(). These changes need to actually be ignored when
extracting the patches as they typically make no sense as actual patches
in a recipe.

This also adds a new test for oe-selftest that verifies that there are
no patches generated from ignored commits.

(From OE-Core rev: c3d43de7e54189bf09fbe8e87ddb976e42ebf531)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
Joshua Watt
ba68f3132d sstatesig: Implement new siggen API
Implements the new API required for querying unihashes in parallel

(From OE-Core rev: 0c66d07238d20dc1b34355e4c472aa7457d2e5fe)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 11:58:12 +00:00