diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/distrodata.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/distrodata.py | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py index 0b454714e9..ad952c004b 100644 --- a/meta/lib/oeqa/selftest/cases/distrodata.py +++ b/meta/lib/oeqa/selftest/cases/distrodata.py @@ -1,14 +1,15 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars -from oeqa.utils.decorators import testcase -from oeqa.utils.ftools import write_file -from oeqa.core.decorator.oeid import OETestID import oe.recipeutils class Distrodata(OESelftestTestCase): - @OETestID(1902) def test_checkpkg(self): """ Summary: Test that upstream version checks do not regress @@ -16,7 +17,7 @@ class Distrodata(OESelftestTestCase): Product: oe-core Author: Alexander Kanavin <alex.kanavin@gmail.com> """ - feature = 'LICENSE_FLAGS_WHITELIST += " commercial"\n' + feature = 'LICENSE_FLAGS_ACCEPTED += " commercial"\n' self.write_config(feature) pkgs = oe.recipeutils.get_recipe_upgrade_status() @@ -40,19 +41,28 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re def test_maintainers(self): """ - Summary: Test that oe-core recipes have a maintainer + Summary: Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe Expected: All oe-core recipes (except a few special static/testing ones) should have a maintainer listed in maintainers.inc file. + Expected: All entries in maintainers list should have a recipe file that matches them Product: oe-core Author: Alexander Kanavin <alex.kanavin@gmail.com> """ def is_exception(pkg): - exceptions = ["packagegroup-", "initramfs-", "systemd-machine-units", "target-sdk-provides-dummy"] + exceptions = ["packagegroup-",] for i in exceptions: if i in pkg: return True return False - feature = 'require conf/distro/include/maintainers.inc\n' + def is_maintainer_exception(entry): + exceptions = ["musl", "newlib", "linux-yocto", "linux-dummy", "mesa-gl", "libgfortran", "libx11-compose-data", + "cve-update-nvd2-native",] + for i in exceptions: + if i in entry: + return True + return False + + feature = 'require conf/distro/include/maintainers.inc\nLICENSE_FLAGS_ACCEPTED += " commercial"\nPARSE_ALL_RECIPES = "1"\nPACKAGE_CLASSES = "package_ipk package_deb package_rpm"\n' self.write_config(feature) with bb.tinfoil.Tinfoil() as tinfoil: @@ -60,6 +70,11 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re with_maintainer_list = [] no_maintainer_list = [] + + missing_recipes = [] + recipes = [] + prefix = "RECIPE_MAINTAINER:pn-" + # We could have used all_recipes() here, but this method will find # every recipe if we ever move to setting RECIPE_MAINTAINER in recipe files # instead of maintainers.inc @@ -69,6 +84,7 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re continue rd = tinfoil.parse_recipe_file(fn, appends=False) pn = rd.getVar('PN') + recipes.append(pn) if is_exception(pn): continue if rd.getVar('RECIPE_MAINTAINER'): @@ -76,6 +92,15 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re else: no_maintainer_list.append((pn, fn)) + maintainers = tinfoil.config_data.keys() + for key in maintainers: + if key.startswith(prefix): + recipe = tinfoil.config_data.expand(key[len(prefix):]) + if is_maintainer_exception(recipe): + continue + if recipe not in recipes: + missing_recipes.append(recipe) + if no_maintainer_list: self.fail(""" The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file. @@ -85,3 +110,8 @@ The following recipes do not have a maintainer assigned to them. Please add an e self.fail(""" The list of oe-core recipes with maintainers is empty. This may indicate that the test has regressed and needs fixing. """) + + if missing_recipes: + self.fail(""" +Unable to find recipes for the following entries in maintainers.inc: +""" + "\n".join(['%s' % i for i in missing_recipes])) |