diff options
| -rw-r--r-- | meta-selftest/files/distrodata/checkpkg_exceptions | 26 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/distrodata.py | 43 |
2 files changed, 69 insertions, 0 deletions
diff --git a/meta-selftest/files/distrodata/checkpkg_exceptions b/meta-selftest/files/distrodata/checkpkg_exceptions new file mode 100644 index 0000000000..f0d1f67487 --- /dev/null +++ b/meta-selftest/files/distrodata/checkpkg_exceptions | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | build-compare | ||
| 2 | calibrateproto | ||
| 3 | dbus-wait | ||
| 4 | distcc | ||
| 5 | fstests | ||
| 6 | gnu-config | ||
| 7 | gst-player | ||
| 8 | kmscube | ||
| 9 | libxcalibrate | ||
| 10 | linux-firmware | ||
| 11 | lsb | ||
| 12 | mmc-utils | ||
| 13 | ovmf | ||
| 14 | piglit | ||
| 15 | psplash | ||
| 16 | puzzles | ||
| 17 | rpm | ||
| 18 | squashfs-tools | ||
| 19 | tcf-agent | ||
| 20 | unzip | ||
| 21 | update-rc.d | ||
| 22 | x264 | ||
| 23 | xcursor-transparent-theme | ||
| 24 | xinetd | ||
| 25 | xvideo-tests | ||
| 26 | zip | ||
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py new file mode 100644 index 0000000000..d5d286d5cc --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/distrodata.py | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | from oeqa.selftest.case import OESelftestTestCase | ||
| 2 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars | ||
| 3 | from oeqa.utils.decorators import testcase | ||
| 4 | from oeqa.utils.ftools import write_file | ||
| 5 | |||
| 6 | class Distrodata(OESelftestTestCase): | ||
| 7 | |||
| 8 | @classmethod | ||
| 9 | def setUpClass(cls): | ||
| 10 | super(Distrodata, cls).setUpClass() | ||
| 11 | cls.exceptions_path = os.path.join(cls.testlayer_path, 'files', 'distrodata', "checkpkg_exceptions") | ||
| 12 | |||
| 13 | def test_checkpkg(self): | ||
| 14 | """ | ||
| 15 | Summary: Test that upstream version checks do not regress | ||
| 16 | Expected: Upstream version checks should succeed except for the recipes listed in the exception list. | ||
| 17 | Product: oe-core | ||
| 18 | Author: Alexander Kanavin <alexander.kanavin@intel.com> | ||
| 19 | """ | ||
| 20 | feature = 'INHERIT += "distrodata"\n' | ||
| 21 | feature += 'LICENSE_FLAGS_WHITELIST += " commercial"\n' | ||
| 22 | |||
| 23 | self.write_config(feature) | ||
| 24 | bitbake('-c checkpkg world') | ||
| 25 | checkpkg_result = open(os.path.join(get_bb_var("LOG_DIR"), "checkpkg.csv")).readlines()[1:] | ||
| 26 | exceptions = [exc.strip() for exc in open(self.exceptions_path).readlines()] | ||
| 27 | failed_upstream_checks = [pkg_data[0] for pkg_data in [pkg_line.split('\t') for pkg_line in checkpkg_result] if pkg_data[11] == ''] | ||
| 28 | regressed_failures = set(failed_upstream_checks) - set(exceptions) | ||
| 29 | regressed_successes = set(exceptions) - set(failed_upstream_checks) | ||
| 30 | msg = "" | ||
| 31 | if len(regressed_failures) > 0: | ||
| 32 | msg = msg + """ | ||
| 33 | The following packages failed upstream version checks. Please fix them using UPSTREAM_CHECK_URI/UPSTREAM_CHECK_REGEX | ||
| 34 | (when using tarballs) or UPSTREAM_CHECK_GITTAGREGEX (when using git). If an upstream version check cannot be performed | ||
| 35 | (for example, if upstream does not use git tags), you can add the package to list of exceptions in | ||
| 36 | meta-selftest/files/distrodata/checkpkg_exceptions. | ||
| 37 | """ + "\n".join(regressed_failures) | ||
| 38 | if len(regressed_successes) > 0: | ||
| 39 | msg = msg + """ | ||
| 40 | The following packages have been checked successfully for upstream versions (or they no longer exist in oe-core), | ||
| 41 | but are in the exceptions list in meta-selftest/files/distrodata/checkpkg_exceptions. Please remove them from that list. | ||
| 42 | """ + "\n".join(regressed_successes) | ||
| 43 | self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg) | ||
