Commit Graph

3143 Commits

Author SHA1 Message Date
Paulo Neves
eb997a6801 utils: Add cmdline_shebang_wrapper util.
Useful to work around shebang relocation issues, where
shebangs are too long or have arguments in them, thus preventing them
from using the /usr/bin/env shebang.

(From OE-Core rev: 6edc1fffcbe1405d8c309a75643d7d6cd9a92848)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-01 12:37:52 +01:00
Paulo Neves
00458ee0f8 oeqa/selftest: Test staged .la and .pc files
These files are checked by qa_check_staged but there was no
test cases for whether the tests actually worked. Now there
are.

(From OE-Core rev: 2a96719a201cb7b8db774718adec89dbd7e1aec3)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-01 12:37:52 +01:00
Paulo Neves
53f0ee8d42 oeqa/selftest: Add test for shebang overflow
Make sure we do not stage any executable with a bigger shebang
than 128. Fixes [1]

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

(From OE-Core rev: 280f68528c93b5ffab888c99190accf59e807a3f)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-01 12:37:52 +01:00
Thomas Roos
603652a38e recipetool/devtool: Fix python egg whitespace issues in PACKAGECONFIG
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]

(From OE-Core rev: a854d95a79e64f3f82abfa4cc1daec750abf4249)

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>
2022-07-01 11:31:42 +01:00
Aryaman Gupta
6958024ed2 buildperf/base.py: skip reduced_proc_pressure directory
Buildperf was designed to skip all non-directories under buildstats, i.e. proc
log files. With the /proc/pressure stats being collected in a new directory,
the following error was seen:
	meta/lib/oeqa/buildperf/base.py", line 392, in split_nevr
    	n_e_v, revision = nevr.rsplit('-', 1)
	ValueError: not enough values to unpack (expected 2, got 1)

Add an additional check to skip the reduced_proc_pressure directory.

(From OE-Core rev: d3a25dd7aa63ab98c8bb931b4b3bc61807806ed3)

Signed-off-by: Aryaman Gupta <aryaman.gupta@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-30 23:38:01 +01:00
Aryaman Gupta
4678581ea0 buildstats.py: close /proc/pressure/cpu file descriptor
Use python 'with' symantics to ensure that the /proc/pressure/cpu file
descriptor used in SystemStats init is closed. Previously, this would
lead to a single file descriptor being leaked. For example:
   ResourceWarning: unclosed file <_io.BufferedReader name='/proc/pressure/cpu'>

(From OE-Core rev: 643653160cd77d346cdc9b9ec25c7212c7dfe176)

Signed-off-by: Aryaman Gupta <aryaman.gupta@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-30 10:54:46 +01:00
Aryaman Gupta
1125adc33b buildstats.bbclass: correct sampling of system stats
The last time of sampling would be updated within the SystemStats class
but not re-recorded into the datastore, leading to multiple samples being
collected in the same second in the sample function of buildstats.py.
Fix this to collect and store only one sample per second within a
certain tolerance to deal with variation in the arrival time.

This fix elimates the spikiness of sampled data, in cases where the difference
between the current and the last sample is taken. Previously, since many
samples per second were recorded, certain types of data would result in a
very small elapsed time and hence a small numerical difference. For example,
the CPU usage from /proc/stat is a running total of usage and taking the
difference between data collected 0.1 seconds apart would result in usage
appearing lower than it actually was.

(From OE-Core rev: 0e2df45ab066bb4ad2c4f8622ee9c1a8ecdea9cb)

Signed-off-by: Aryaman Gupta <aryaman.gupta@windriver.com>
Signed-off-by: Randy MacLeod <randy.macleod@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-29 16:16:56 +01:00
Aryaman Gupta
ac162116b3 buildstats.py: enable collection of /proc/pressure data
The Linux pressure monitoring system helps determine when system resources
are being overutilized by measuring how contended the CPU, IO and memory are.
This information can be found under /proc/pressure/ which contains 3 files -
cpu, memory and io. In each of the files, the format is as follows:
	some avg10=70.24 avg60=68.52 avg300=69.91 total=3559632828
	full avg10=57.59 avg60=58.06 avg300=60.38 total=3300487258

The "some" state of a given resource represents when one or more tasks are delayed
on that resource whereas the "full" state represents when all the tasks are
delayed. Currently, we only collect data from the "some" state but the
"full" data can simply be appended to the log files if neccessary.
The "avg10", "avg60" and "avg300" fields represent the average percentage
of time runnable tasks were delayed in the last 10, 60 or 300 seconds
respectively. The "total" field represents the total time, in microseconds,
that some runnable task was delayed on a resource.
More information can be found at:
	https://www.kernel.org/doc/html/latest/accounting/psi.html
and in the source code under kernel/sched/psi.c

This commit adds functionality to collect and log the "some" CPU, memory and IO
pressure. The "avg10", "avg60" and "avg300" fields are logged without change.
In place of the "total" field, the difference between the current "total" and
the previous sample's "total" is logged, allowing the measurement of pressure
in between each polling interval, as was done for /proc/stat data. The log files
are stored in:
	<build_name>/tmp/buildstats/<build_time>/reduced_proc_pressure/{cpu,io,memory}.log
mirroring the directory structure of /proc/pressure. If the /proc/pressure
directory does not exist or the resource files can't be read/opened, the
reduced_proc_pressure directory is not created.

(From OE-Core rev: 061931520b8baa7f3a03bf466aa9ec8bf995bc14)

Signed-off-by: Aryaman Gupta <aryaman.gupta@windriver.com>
Signed-off-by: Randy MacLeod <randy.macleod@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-29 16:16:56 +01:00
Richard Purdie
ddbd90a37c bitbake.conf: Change -dev RDEPENDS to RRECOMMENDS
Switch the default DEPENDS for ${PN}-dev to be a RRECOMMENDS instead. This
takes advantage of a change to complmentary package globbing to not follow
RRECOMMENDS and means and SDK for an image with both openssh and dropbear
compoments will now build successfully.

(From OE-Core rev: 6f28420ab0e8f2ab5eb06326024777a40aded0a6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-28 23:49:38 +01:00
Ross Burton
4705dd2646 package_manager: Change complementary package handling to not include soft dependencies
We've some long standing bugs where the RDEPENDS from -dev packages causes
problems, e.g. dropbear and openssh components on an image working fine together
but then the SDK failing to build as the main openssh and dropbear packages
conflict with each other (pulled in by openssh-dev and dropbear-dev).

We propose changing the behavour of complementary package installation to
ignore RRECOMMENDS. If we then change the ${PN}-dev dependency on ${PN}
to a RRECOMMENDS, we can avoid many of the issues people run into yet still
have the desired behaviour of ${PN}-dev pulling in ${PN}.

This therefore changes the package manager code so that it doesn't follow
RRECOMMENDS for completementary package globs.

[RP: Added deb support]
(From OE-Core rev: b44b0b9294675f89aa51ff84f532664f4c479677)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-28 23:49:37 +01:00
Enrico Scholz
6ca69f66ba lib:npm_registry: initial checkin
Helper module to:

- generate meta information from package.json content.  This data has
  a format as provided by https://registry.npmjs.org

- put this meta information and the corresponding tarball in the
  nodejs cache.  This uses an external, nodejs version specific helper
  script (oe-npm-cache) shipped in oe-meta

To avoid further nodejs version dependencies, future versions of this
module might omit the caching completely and serve meta information
and tarball by an http server.

(From OE-Core rev: 6cd5886ad05fee704e8a5892bd370c360c8c3b54)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-28 12:55:26 +01:00
Richard Purdie
bbdda8321d oeqa/runtime/scp: Disable scp test for dropbear
Fedora is switching to use sftp as the backend for scp. This means the
scp test fails on Fedora 36 hosts with a dropbear target as dropbear
doesn't support sftp. This change is in the upstream openssh code, other
distros have not yet changed the default but probably will follow.

The easiest way to resolve test failures in dropbear images is to stop
testing this against dropbear as it is no longer expected to work and will
likely spread as the change filters through other distros.

(From OE-Core rev: a71fc7d455400f406b0d607be712a1133fe91166)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-25 21:13:40 +01:00
Alexander Kanavin
f23474acfa oeqa/sdk: drop the nativesdk-python 2.x test
Python 2.x has been EOL for a while, and so this test
never runs.

(From OE-Core rev: b687627e9cffb8123c156413f55ea1929f1a7831)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-25 21:13:40 +01:00
Marta Rybczynska
91982f65f3 oeqa/selftest/cve_check: add tests for Ignored and partial reports
Add testcases for partial reports with CVE_CHECK_REPORT_PATCHED and
Ignored CVEs.

(From OE-Core rev: 3f7639b90004973782a2e74925fd2e9a764c1090)

Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-17 17:57:44 +01:00
ssuesens
b4206958f5 weston.py: added xwayland test
Test xwayland support if DISTRO_FEATURE X11 is enabled

Test checked if xserver listening on display

(From OE-Core rev: c8dea13bd65f1695c79eba26b092d411a1699b19)

Signed-off-by: ssuesens <sebastian.suesens@baslerweb.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-15 12:27:01 +01:00
Joshua Watt
ec2f329787 classes/create-spdx: Add SPDX_PRETTY option
Adds an option to make the SPDX more human-readable (at the expense of a
larger files)

(From OE-Core rev: 4799594b26f77ed259dc661bf077519b338390c8)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-15 12:27:01 +01:00
Mingli Yu
c9ce23f04b oescripts: change compare logic in OEListPackageconfigTests
When multilib enabled and add layers/meta-openembedded/meta-oe in
conf/bblayers.conf, it reports below error when run oe-selftest.
 $ oe-selftest -r  oescripts
 [snip]
 [20:36:33-0700] 2022-05-16 03:36:33,494 - oe-selftest - INFO - RESULTS - oescripts.OEListPackageconfigTests.test_packageconfig_flags_option_flags: FAILED (585.37s)
 [snip]

 It is because the output of "list-packageconfig-flags.py -f" as below:
 $ ../scripts/contrib/list-packageconfig-flags.py -f
 [snip]
 qt                     lib32-pinentry  lib32-wxwidgets  nativesdk-pinentry  pinentry  pinentry-native  wxwidgets  wxwidgets-native
 secret                 lib32-pinentry  nativesdk-pinentry  pinentry  pinentry-native
 [snip]

 But the check logic as below:
 class OEListPackageconfigTests(OEScriptTests):
    #oe-core.scripts.List_all_the_PACKAGECONFIG's_flags
    def check_endlines(self, results,  expected_endlines):
        for line in results.output.splitlines():
            for el in expected_endlines:
                if line.split() == el.split():
                    expected_endlines.remove(el)
                    break

 def test_packageconfig_flags_option_flags(self):
        results = runCmd('%s/contrib/list-packageconfig-flags.py -f' % self.scripts_dir)
        expected_endlines = []
        expected_endlines.append("PACKAGECONFIG FLAG     RECIPE NAMES")
        expected_endlines.append("qt                     nativesdk-pinentry  pinentry  pinentry-native")
        expected_endlines.append("secret                 nativesdk-pinentry  pinentry  pinentry-native")

        self.check_endlines(results, expected_endlines)

And the test will fail as line.split() doesn't equal el.split() as
line.split() is ['lib32-pinentry', 'lib32-wxwidgets', 'nativesdk-pinentry',
'pinentry', 'pinentry-native', 'wxwidgets', 'wxwidgets-native'] and
el.split() is ['nativesdk-pinentry', 'pinentry', 'pinentry-native'].

So change the compare logic to fix the gap.

(From OE-Core rev: 239f22847bcae0cb31769adb0a42b5440173a7c5)

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-14 10:04:02 +01:00
Richard Purdie
38a9622ba3 base/buildhistory/image-buildinfo: Use common buildcfg function
Reduce code duplication to a common function in oe.buildcfg.

(From OE-Core rev: 0b191a1df4c3722defb09dde0c16b1d9e7fe7ef6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:30:57 +01:00
Richard Purdie
3ae4dd140a buildcfg: Drop unused svn revision function
This isn't used anywhere and everyone is using git now, the functions
are now hardcoded as such too. Drop this function.

(From OE-Core rev: 09ba96a2d7fa02c7a82758bbf4109b04ffca2c55)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:30:57 +01:00
Richard Purdie
5266670b2d lib/buildcfg: Share common clean/dirty layer function
The comments even say this was copy/paste code. Move to a
shared library function.

(From OE-Core rev: ac3de2f850a418673b87e1c454970cb099e191b0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:30:57 +01:00
Richard Purdie
ba85bb6055 classes/buildcfg: Move git/layer revision code into new OE module buildcfg
There is a load of duplicated git/layer/revision code which makes
most sesne as a python library, not bbclass code. Start to refactor as such.

(From OE-Core rev: 439cdf8a1e52fd2c4dc81dc40ce7e6af282ce7ac)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:30:56 +01:00
Richard Purdie
f707d9bb96 selftest/multiconfig: Test that multiconfigs in separate layers works
We should test that mutliconfigs from a layer work, not just build/conf.
This adds such a test.

[YOCTO #13566]

(From OE-Core rev: 2306261fb85d5d03145989c3af9c6897111644ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-11 10:28:22 +01:00
Martin Jansa
1025118484 rootfs.py: close kernel_abi_ver_file
* fixes:
  oe-core/meta/lib/oe/rootfs.py:331: ResourceWarning: unclosed file <_io.TextIOWrapper name='pkgdata/mach/kernel-depmod/kernel-abiversion' mode='r' encoding='UTF-8'>
  kernel_ver = open(kernel_abi_ver_file).read().strip(' \n')

(From OE-Core rev: f9dd8ee063c1132265248457fcd628e1e93727be)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-08 21:55:56 +01:00
Sean Anderson
25c2ca903a rootfs.py: find .ko.zst kernel modules
With CONFIG_MODULE_COMPRESS_ZSTD enabled, kernel modules will have a
.ko.zst extension. This fixes depmod not being run.

Fixes: 1b696a45ddb ("rootfs.py: Add check for kernel modules before running depmod")
(From OE-Core rev: 425efac7110f0f42d70643e0a448e834d0f01a7a)

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-06 13:36:05 +01:00
Marta Rybczynska
4417c376f6 cve-check: move update_symlinks to a library
Move the function to a library, it could be useful in other places.

(From OE-Core rev: debd37abcdde8788761ebdb4a05bc61f7394cbb8)

Signed-off-by: Marta Rybczynska <marta.rybczynska@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-06 13:36:05 +01:00
Martin Jansa
b3b76a984c patch.py: make sure that patches/series file exists before quilt pop
* Since quilt upgrade to 0.67 some recipes sometimes fail in do_patch with
  errors like:

  ERROR: Applying patch 'GPLv2.patch' on target directory '/OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/keymaps/1.0-r31'
  CmdError('quilt --quiltrc /OE/build/oe-core/tmp-glibc/work/qemux86_64-oe-linux/keymaps/1.0-r31/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout:
  stderr: File series fully applied, ends at patch GPLv2.patch
  ')

* It affects only recipes with S = "${WORKDIR}", which wipe only
  ${S}/patches, because in other cases whole ${S} is wiped when
  do_unpack is re-executed.

* It was originally added in:
  https://git.openembedded.org/openembedded-core/commit/?id=5fe5e6a15f26f23f0c5b863fafad7a0d382a55e2

  since then it was extended to wipe whole ${S} when ${S} != ${WORKDIR} in:
  https://git.openembedded.org/openembedded-core/commit/?id=5fe5e6a15f26f23f0c5b863fafad7a0d382a55e2
  https://git.openembedded.org/openembedded-core/commit/?id=eccae514b71394ffaed8fc45dea7942152a334a1

  this is now causing issues to quilt-0.67 because it checks that
  ${S}/patches/series exists during 'quilt pop -a -f' which we call
  from QuiltTree.Clean to undo patches possibly already applied
  in ${S} in previous do_patch execution.

* There are couple recipes affected by this e.g. keymaps (.patch already
  removed in oe-core), makedevs (.patch removal sent to ML yesterday
  https://lists.openembedded.org/g/openembedded-core/message/166172),
  devmem2
  (https://lists.openembedded.org/g/openembedded-devel/message/97270), but
  there are other recipes with S = "${WORKDIR}" where you can trigger this
  e.g. by having a .patch file in DISTRO layer .bbappend (e.g. tzdata with
  webOS
  06e5298d9f/meta-webos/recipes-extended/tzdata/tzdata.bbappend (L10))

  This do_patch issue is caused by:
  https://git.savannah.nongnu.org/cgit/quilt.git/commit/?id=8b39a960afcf45cd4f5804ae62b6b0656bdb191d
  introduced in kirkstone with:
  https://git.openembedded.org/openembedded-core/commit/?h=kirkstone&id=fa71afcee9ab42198c619333b77a15bd2ae02b20

  The shortest sequence to reproduce this is just
  bitbake keymaps -c patch
  bitbake keymaps -c unpack -f
  bitbake keymaps -c patch
  with
  https://git.openembedded.org/openembedded-core/commit/?id=17d981005a0c0c97702ad88602b7181b69bcc9eb
  reverted.

  And the change in quilt behavior is causing QuiltTree.Clean (quilt pop -a -f) in:
  https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/patch.py?id=17d981005a0c0c97702ad88602b7181b69bcc9eb#n601

  to silently fail with "No series file found" before undoing the
  patches in ${S} and then quilt push failing, because all the
  patches are _still_ applied in ${S}.

  Removing ".pc" doesn't help, because we really
  need quilt's help to undo the patches (in this case to delete COPYING
  file from WORKDIR before applying the .patch which tries to add it
  again), because do_unpack cannot just wipe S and start over (because S
  == WORKDIR) - nor selectively removing the files listed in SRC_URI,
  because COPYING file isn't listed there.

  Using skip_series_check in 'quilt pop' (partially reverting the change
  from upstream) does fix this as well and it's simple one line patch
  (just adding skip_series_check=1 in pop.in), but might be difficult
  to upstream, because it's this strange OE specific behavior that we
  remove 'patches' directory and then still need quilt pop to work.

(From OE-Core rev: c9d36882044b1c633d8611a77df54cd68c9bee25)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-31 15:24:18 +01:00
Richard Purdie
a8734a82a1 oeqa/imagefeatures: Disable squashfs-lzo
(From OE-Core rev: c8c8b5265c831a2827a3891c7b326b25eae7f681)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-29 23:58:00 +01:00
Richard Purdie
cf1a4bfe8e oeqa/imagefeatures: Replace lzo with zst
We may remove lzo so switch the test case to zstd.

(From OE-Core rev: f749a8b462b915713912342444f981125938a990)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-29 23:58:00 +01:00
Tobias Schmidl
fd255af7de oeqa/selftest/wic.py: Repaired test_qemu()
The grep is too wide, so it falsely fits additional lines that have
a UUID (i.e, `/`).

(From OE-Core rev: f72fdea1c890ddd793aa63bb9c1c0857962161cc)

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-27 23:50:48 +01:00
Ross Burton
8346dc9d5d oeqa/selftest/cve_check: add tests for recipe and image reports
Add a test to verify that the JSON reports are generated correctly for
both single recipe builds and image builds.

More tests are needed, but this is better than nothing.

(From OE-Core rev: df0f35555b09c4bc75470eb45ec9c74e6587d460)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-20 22:52:23 +01:00
Richard Purdie
88c200c751 selftest/imagefeatures/overlayfs: Always append to DISTRO_FEATURES
Using += unintentionally removes all other entries from DISTRO_FEATURES
if DISTRO_FEATURES was set by ?= such as by poky.conf. This reduces
sstate reusage on the autobuilder. Fix this to speed up builds.

(From OE-Core rev: 124b82c32c4545bb216a8249954817f692f9795a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-16 23:19:18 +01:00
Steve Sakoman
eaa61803b1 virgl: skip headless test on alma 8.6
As a centos 8 spinoff, it lacks the same vgem kernel module.

(From OE-Core rev: 451605aa40482516c18cd1534feacb796516a785)

(From OE-Core rev: 8f74418637fbcdd7c68636ec1b9adfffc245f9c1)

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-15 08:49:22 +01:00
Ross Burton
f28cca6abc oeqa/selftest: add test for git working correctly inside pseudo
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] 8959555cee

(From OE-Core rev: 46822268040a23dbb81f71fe35aee8c2663a31f6)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-07 22:31:21 +01:00
Claudius Heine
78b4102922 classes: rootfs-postcommands: add skip option to overlayfs_qa_check
The overlayfs_qa_check checks if the current root file system has a
mount configured for each overlayfs, when the overlayfs class is used.

However there are certain instances where this mount point is created at
runtime and not static in a fstab entry or systemd mount unit.

One such case would be if overlayfs-etc is used, where the device is
mounted in the preinit script and not via a mount unit or fstab entry.

However there are other possibilities for this as well, like startup
scripts that support a dynamic partition layout. For instance when
systemd-repart is used.

This adds the `OVERLAYFS_QA_SKIP` variable, which allows to define QA
skips via its flags. In principle it supports multiple QA skip flags
separated by whitespace, but only one (`mount-configured`) is
implemented here. To skip this QA check simply add `mount-configured` to
the flag of `OVERLAYFS_QA_SKIP` with the same name. For instance if a
overlayfs is configured as:

	OVERLAYFS_MOUNT_POINT[data] = "/data"

Skipping this QA check can be done by setting:

	OVERLAYFS_QA_SKIP[data] = "mount-configured"

Also add a testcase and fix a typo (fstat -> fstab).

(From OE-Core rev: 2ce9173169a2a86392c4a85fe9be7fbbd7353b7f)

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-03 17:49:50 +01:00
Richard Purdie
e141d586f2 lib/sstatesig: Fix find_siginfo to match sstate filename generation
sstate filename generation was changed a while ago and taskname has to be
passed into core functions for the correct filename to be generated. Update
find_siginfo to match those changes and pass in taskname via SSTATE_CURRTASK.

Thanks to Gregory Lumen <gregorylumen@microsoft.com> for spotting.

[YOCTO #14774]

(From OE-Core rev: 51d7310b6cf8ef9033d461868c07f686656070ba)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-29 17:54:25 +01:00
Ross Burton
fa553eb643 cve_check: skip remote patches that haven't been fetched when searching for CVE tags
If a remote patch is compressed we need to have run the unpack task for
the file to exist locally.  Currently cve_check only depends on fetch so
instead of erroring out, emit a warning that this file won't be scanned
for CVE references.

Typically, remote compressed patches won't contain our custom tags, so
this is unlikely to be an issue.

(From OE-Core rev: cefc8741438c91f74264da6b59dece2e31f9e5a5)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-28 11:51:41 +01:00
Chen Qi
57627d99bd cases/buildepoxy.py: fix typo
(From OE-Core rev: 3a9b6e71d1e7e8e2ebc0ed047841e36f09300387)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-26 18:25:08 +01:00
Peter Kjellerstedt
1e48a0e438 terminal.py: Restore error output from Terminal
In bitbake commit 1ecc1d94 (process: Do not mix stderr with stdout),
bb.process.Popen() was changed to no longer combine stdout and stderr by
default. However, the Terminal class was not updated to reflect this and
subsequently only output stdout in case of failures.

(From OE-Core rev: 116d0bb07ba044cf8847bf3d5c3996ad7e58b7ae)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-26 18:25:08 +01:00
Ferry Toth
4a3f3f2c34 apt: add apt selftest to test signed package feeds
Since Gatesgarth apt (1.8.2) has become more strict and doesn’t allow unsigned repositories by default.
Currently when building images this requirement is worked around by using [allow-insecure=yes] and
equivalently when performing selftest.

Patches "gpg-sign: Add parameters to gpg signature function" and "package_manager: sign DEB package feeds"
enable signed DEB package feeds. This patch adds a runtime test for apt derived from the test_testimage_dnf
test. It creates a signed deb package feed, runs a qemu image to install the key and performs some package
management. To be able to install the key the gnupg package is added to the testimage.

(From OE-Core rev: 3ec30490d09d6639eea2638cf12a323948f221cc)

Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-19 14:14:11 +01:00
Paulo Neves
15df00f0f0 selftest/lic_checksum: Add test for filename containing space
A fix is being added to bitbake to correctly handle spaces inside
checksum filenames. Add a test to oe-selftest to ensure this is
tested and doesn't regress in future.

(From OE-Core rev: 324109f034f069ee3e91a1a705b3449911a448de)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-19 14:14:11 +01:00
Ferry Toth
0b4231b597 package_manager: sign DEB package feeds
Implement debian package repository signature.
For each Release file created in repository subdirectory, a signature
Release.gpg is created.

Signature is performed using gpg backend when the following variables
are set in local.conf:
PACKAGE_CLASSES += "sign_package_feed"
PACKAGE_FEED_GPG_NAME = "<Id of GPG key>"
PACKAGE_FEED_GPG_PASSPHRASE_FILE="<path to password file>"

(From OE-Core rev: fcc3cee276999efe6402959eb295e7a0e1e96f96)

Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-05 22:25:13 +01:00
Xavier Berger
bd8f1f7787 gpg-sign: Add parameters to gpg signature function
output_suffix: If defined, add output_suffix as file name extension.
use_sha256: If True, use sha256 for gpg as digest algorithm

(From OE-Core rev: cfcaa54dc73925df448099fb60f75b18350b2a3b)

Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-05 22:25:13 +01:00
Ross Burton
9bcf56e6e7 oeqa/selftest: generalise test_devtool_virtual_kernel_modify
Generalise this test so that it works on more than qemux86-64:

- Don't edit a file in arch/x86 to cause a rebuild, instead use init/
- Look for the edits in the build tree, as the deployed kernel could be
  of any type (zImage/bzImage/etc) and edits may be in the compressed
  part.

Also remove redundant checks on the result of runCmd(), as this will
raise AssertionError exceptions itself so the explicit asserts will
never trigger.

(From OE-Core rev: f1d2b2ec51f748a28d1bca6615558d553876e5c3)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
c4436040eb oeqa/selftest/wic: use self.td instead of get_bb_var to save on bitbake calls
When a test case starts, self.td is populated with all the variables in
the data store.  Typically this can be used instead of get_bb_var(),
which saves a bitbake call per variable lookup.

The only catch is that in parallel runs the build directory is moved
after td is populated, so paths in the build directory are wrong: these
still need to be fetched in the test.

(From OE-Core rev: 884201c6c1bbf7c1b958bab7d7c91e27577eeaac)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
12a1456b06 oeqa/selftest/wic: use os.path.join to join paths
Instead of using string concatenation, use os.path.join.

(From OE-Core rev: 73d1b7163792ec089ffb3bf99f1b4f8760beaea7)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
ada2cbb682 oeqa/selftest/wic: rearrange tests
Split the tests into further classes: one which exercises the CLI and
doesn't need to build images at all, and another which is just the
tests that manipulate existing images.

(From OE-Core rev: c9bc4def71325dba7b7ad93001f7fe1acced0bea)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:38 +01:00
Ross Burton
443d557ba0 oeqa/selftest/wic: cleanup WicTestCase.setUpLocal
Use os.path.join to construct paths, and invoke bitbake once instead of
three times.

(From OE-Core rev: 27953d4cf6edc86cd505826c3da21222864c7760)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
679917f98f oeqa/selftest/oescripts: refactor skipping logic
OEScriptTests currently skips if cairo isn't present, and does a build
of core-image-minimal.  This is only required for the
OEPybootchartguyTests tests, so move that logic there so that the
OEListPackageconfigTests run even if cairo isn't available.

This leaves OEScriptTests as a simple class containing the scripts_dir
assignment, which can then be reused by other tests to avoid code
duplication.

(From OE-Core rev: fe3ee517772ad8396fcac21ae7eb8d1c8b68fbdb)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
fcc9c0ab37 oeqa: rationalise skipifqemu decorators
(From OE-Core rev: 1a3a37cc2b16a8d5cd2258b0b35be43baa363f67)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00
Ross Burton
416cce968d oeqa/selftest: tag tests that use runqemu
There may be environments or machines which don't have working runqemu,
so tag all of the tests which use runqemu() so that they can be skipped.

(From OE-Core rev: 3f45ce6d2b1dfde8bc3d554397d55f81846c52d5)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +01:00