summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/distrodata.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/distrodata.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/distrodata.py34
1 files changed, 32 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py
index 68ba556485..5f7f488349 100644
--- a/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -42,8 +42,9 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
42 42
43 def test_maintainers(self): 43 def test_maintainers(self):
44 """ 44 """
45 Summary: Test that oe-core recipes have a maintainer 45 Summary: Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe
46 Expected: All oe-core recipes (except a few special static/testing ones) should have a maintainer listed in maintainers.inc file. 46 Expected: All oe-core recipes (except a few special static/testing ones) should have a maintainer listed in maintainers.inc file.
47 Expected: All entries in maintainers list should have a recipe file that matches them
47 Product: oe-core 48 Product: oe-core
48 Author: Alexander Kanavin <alex.kanavin@gmail.com> 49 Author: Alexander Kanavin <alex.kanavin@gmail.com>
49 """ 50 """
@@ -54,7 +55,16 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
54 return True 55 return True
55 return False 56 return False
56 57
57 feature = 'require conf/distro/include/maintainers.inc\n' 58 def is_maintainer_exception(entry):
59 exceptions = ["systemd", "musl", "libpam", "newlib", "linux-yocto", "opensbi", "linux-dummy",
60 "mesa-gl", "libgfortran", "volatile-binds", "libgloss", "bsd-headers",
61 "cve-update-db-native", "libssp-nonshared", "argp-standalone", "fts"]
62 for i in exceptions:
63 if i in entry:
64 return True
65 return False
66
67 feature = 'require conf/distro/include/maintainers.inc\nLICENSE_FLAGS_WHITELIST += " commercial"\n'
58 self.write_config(feature) 68 self.write_config(feature)
59 69
60 with bb.tinfoil.Tinfoil() as tinfoil: 70 with bb.tinfoil.Tinfoil() as tinfoil:
@@ -62,6 +72,11 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
62 72
63 with_maintainer_list = [] 73 with_maintainer_list = []
64 no_maintainer_list = [] 74 no_maintainer_list = []
75
76 missing_recipes = []
77 recipes = []
78 prefix = "RECIPE_MAINTAINER_pn-"
79
65 # We could have used all_recipes() here, but this method will find 80 # We could have used all_recipes() here, but this method will find
66 # every recipe if we ever move to setting RECIPE_MAINTAINER in recipe files 81 # every recipe if we ever move to setting RECIPE_MAINTAINER in recipe files
67 # instead of maintainers.inc 82 # instead of maintainers.inc
@@ -71,6 +86,7 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
71 continue 86 continue
72 rd = tinfoil.parse_recipe_file(fn, appends=False) 87 rd = tinfoil.parse_recipe_file(fn, appends=False)
73 pn = rd.getVar('PN') 88 pn = rd.getVar('PN')
89 recipes.append(pn)
74 if is_exception(pn): 90 if is_exception(pn):
75 continue 91 continue
76 if rd.getVar('RECIPE_MAINTAINER'): 92 if rd.getVar('RECIPE_MAINTAINER'):
@@ -78,6 +94,15 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
78 else: 94 else:
79 no_maintainer_list.append((pn, fn)) 95 no_maintainer_list.append((pn, fn))
80 96
97 maintainers = tinfoil.config_data.keys()
98 for key in maintainers:
99 if key.startswith(prefix):
100 recipe = tinfoil.config_data.expand(key[len(prefix):])
101 if is_maintainer_exception(recipe):
102 continue
103 if recipe not in recipes:
104 missing_recipes.append(recipe)
105
81 if no_maintainer_list: 106 if no_maintainer_list:
82 self.fail(""" 107 self.fail("""
83The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file. 108The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file.
@@ -87,3 +112,8 @@ The following recipes do not have a maintainer assigned to them. Please add an e
87 self.fail(""" 112 self.fail("""
88The list of oe-core recipes with maintainers is empty. This may indicate that the test has regressed and needs fixing. 113The list of oe-core recipes with maintainers is empty. This may indicate that the test has regressed and needs fixing.
89""") 114""")
115
116 if missing_recipes:
117 self.fail("""
118Unable to find recipes for the following entries in maintainers.inc:
119""" + "\n".join(['%s' % i for i in missing_recipes]))