summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@konsulko.com>2024-11-19 19:22:42 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-12-03 11:42:35 +0000
commit2d10a8f522b5087ca1518b50ed93696d749b2b5f (patch)
treef36c04897df57c2c3ad9fb524929aae7b0e49cb9
parent6180bac513aa2b98e25d775862b62f57652cf076 (diff)
downloadpoky-2d10a8f522b5087ca1518b50ed93696d749b2b5f.tar.gz
yocto-check-layer: expand to cover all required QA checks
insane.bbclass now defines CHECKLAYER_REQUIRED_TESTS list with required QA checks that are becoming mandatory for Yocto Project Compatible layers. Update yocto-check-layer.bbclass in order to catch when packages from such layers try to skip any of the required QA checks. (From OE-Core rev: 9c3ba88628853b20fb4c98c99cf3fe8349024016) Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/yocto-check-layer.bbclass28
-rw-r--r--meta/classes/yocto-check-layer.bbclass22
2 files changed, 28 insertions, 22 deletions
diff --git a/meta/classes-global/yocto-check-layer.bbclass b/meta/classes-global/yocto-check-layer.bbclass
new file mode 100644
index 0000000000..1cdab49661
--- /dev/null
+++ b/meta/classes-global/yocto-check-layer.bbclass
@@ -0,0 +1,28 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7#
8# This class is used by yocto-check-layer script to ensure that packages
9# from Yocto Project Compatible layers don't skip required QA checks listed
10# in CHECKLAYER_REQUIRED_TESTS defined by insane.bbclass
11#
12# It adds an anonymous python function with extra processing to all recipes,
13# globally inheriting this class isn't advisable - yocto-check-layer script
14# handles that during its signature dump
15#
16
17python () {
18 required_tests = set((d.getVar('CHECKLAYER_REQUIRED_TESTS') or '').split())
19 packages = set((d.getVar('PACKAGES') or '').split())
20 for package in packages:
21 skip = set((d.getVar('INSANE_SKIP') or "").split() +
22 (d.getVar('INSANE_SKIP:' + package) or "").split())
23 skip_required = skip & required_tests
24 if skip_required:
25 oe.qa.write_error(" ".join(skip_required), 'Package %s is skipping required QA tests.' % package, d)
26 bb.error("QA Issue: %s [%s]" % ('Package %s is skipping required QA tests.' % package, " ".join(skip_required)))
27 d.setVar("QA_ERRORS_FOUND", "True")
28}
diff --git a/meta/classes/yocto-check-layer.bbclass b/meta/classes/yocto-check-layer.bbclass
deleted file mode 100644
index 404f5fd9f2..0000000000
--- a/meta/classes/yocto-check-layer.bbclass
+++ /dev/null
@@ -1,22 +0,0 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7#
8# This class is used by yocto-check-layer script for additional per-recipe tests
9# The first test ensures that the layer has no recipes skipping 'installed-vs-shipped' QA checks
10#
11
12WARN_QA:remove = "installed-vs-shipped"
13ERROR_QA:append = " installed-vs-shipped"
14
15python () {
16 packages = set((d.getVar('PACKAGES') or '').split())
17 for package in packages:
18 skip = set((d.getVar('INSANE_SKIP') or "").split() +
19 (d.getVar('INSANE_SKIP:' + package) or "").split())
20 if 'installed-vs-shipped' in skip:
21 oe.qa.handle_error("installed-vs-shipped", 'Package %s is skipping "installed-vs-shipped" QA test.' % package, d)
22}