| |
@@ -502,7 +502,7 @@
|
| |
|
| |
def _add_test_rpm(self, nevra, srpm_nevra, multilib=None,
|
| |
koji_srpm_nevra=None, excludearch=None, exclusivearch=None,
|
| |
- license=None):
|
| |
+ license=None, requires=None):
|
| |
"""
|
| |
Helper method to add test RPM to ModuleBuild used by KojiContentGenerator
|
| |
and also to Koji tag used to generate the Content Generator build.
|
| |
@@ -518,6 +518,7 @@
|
| |
:param list excludearch: List of architectures this package is excluded from.
|
| |
:param list exclusivearch: List of architectures this package is exclusive for.
|
| |
:param str license: License of this RPM.
|
| |
+ :param list requires: List of requires.
|
| |
"""
|
| |
srpm_name = kobo.rpmlib.parse_nvra(srpm_nevra)["name"]
|
| |
|
| |
@@ -532,6 +533,7 @@
|
| |
parsed_nevra["excludearch"] = excludearch or []
|
| |
parsed_nevra["exclusivearch"] = exclusivearch or []
|
| |
parsed_nevra["license"] = license or ""
|
| |
+ parsed_nevra["requires"] = requires or []
|
| |
self.cg.rpms.append(parsed_nevra)
|
| |
self.cg.rpms_dict[nevra] = parsed_nevra
|
| |
|
| |
@@ -888,3 +890,173 @@
|
| |
side_effect=koji.GenericError('Build already exists asdv'))
|
| |
self.cg.koji_import()
|
| |
tagger.assert_called()
|
| |
+
|
| |
+ def test_fill_in_rpms_list_debuginfo_deps(self):
|
| |
+ """
|
| |
+ Tests that -debuginfo RPM required by other -debuginfo RPM is included in a RPM list.
|
| |
+
|
| |
+ The python3-pymongo has matching python3-pymongo-debuginfo RPM which requires
|
| |
+ python-pymongo-debuginfo RPM. All of them should appear in RPM list
|
| |
+ """
|
| |
+ self._add_test_rpm(
|
| |
+ "python-pymongo-debuginfo-3.6.1-9.module+f29.1.0+2993+d789589b.x86_64",
|
| |
+ "python-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.src",
|
| |
+ requires=["rpmlib(CompressedFileNames)", "rpmlib(FileDigests)",
|
| |
+ "rpmlib(PayloadFilesHavePrefix)", "rpmlib(PayloadIsXz)"])
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python3-pymongo-debuginfo-3.6.1-9.module+f29.1.0+2993+d789589b.x86_64",
|
| |
+ "python-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.src",
|
| |
+ requires=["python-pymongo-debuginfo(x86_64)", "rpmlib(CompressedFileNames)",
|
| |
+ "rpmlib(FileDigests)", "rpmlib(PayloadFilesHavePrefix)",
|
| |
+ "rpmlib(PayloadIsXz)"])
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python3-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.x86_64",
|
| |
+ "python-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.src",
|
| |
+ "python-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.src")
|
| |
+
|
| |
+ mmd = self.cg.module.mmd()
|
| |
+ mmd = self.cg._fill_in_rpms_list(mmd, "x86_64")
|
| |
+
|
| |
+ assert set(mmd.get_rpm_artifacts().get()) == set([
|
| |
+ 'python-pymongo-debuginfo-0:3.6.1-9.module+f29.1.0+2993+d789589b.x86_64',
|
| |
+ 'python3-pymongo-debuginfo-3.6.1-9.module+f29.1.0+2993+d789589b.x86_64',
|
| |
+ 'python-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.src',
|
| |
+ 'python3-pymongo-3.6.1-9.module+f29.1.0+2993+d789589b.x86_64'])
|
| |
+
|
| |
+ def test_fill_in_rpms_list_debuginfo_deps_psycopg2(self):
|
| |
+ """
|
| |
+ Tests that -debuginfo RPM required by other -debuginfo RPM is included in a RPM list
|
| |
+ with the psycopg2 RPM test-case, because psycopg2 RPMs are built in kind of special
|
| |
+ way...
|
| |
+ """
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-debuginfo-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src",
|
| |
+ requires=["python-psycopg2-debuginfo(x86-64)"])
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-debug-debuginfo-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src",
|
| |
+ requires=["python-psycopg2-debuginfo(x86-64)"])
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python-psycopg2-debugsource-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python-psycopg2-debuginfo-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-tests-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-debug-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ mmd = self.cg.module.mmd()
|
| |
+ mmd = self.cg._fill_in_rpms_list(mmd, "x86_64")
|
| |
+
|
| |
+ assert set(mmd.get_rpm_artifacts().get()) == set([
|
| |
+ "python2-psycopg2-debuginfo-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python2-psycopg2-debug-debuginfo-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-debugsource-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-debuginfo-0:2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python2-psycopg2-tests-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python2-psycopg2-debug-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python2-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src"])
|
| |
+
|
| |
+ def test_fill_in_rpms_list_debugsource_for_non_srpm(self):
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-debugsource-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python2-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src")
|
| |
+
|
| |
+ mmd = self.cg.module.mmd()
|
| |
+ mmd = self.cg._fill_in_rpms_list(mmd, "x86_64")
|
| |
+
|
| |
+ assert set(mmd.get_rpm_artifacts().get()) == set([
|
| |
+ "python2-psycopg2-debugsource-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python2-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.x86_64",
|
| |
+ "python-psycopg2-2.7.5-7.module+f29.0.0+2961+596d0223.src"])
|
| |
+
|
| |
+ def test_fill_in_rpms_list_debuginfo_deps_glibc(self):
|
| |
+ self._add_test_rpm(
|
| |
+ "glibc-common-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-2.29.9000-16.fc31.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "glibc-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-2.29.9000-16.fc31.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "glibc-debuginfo-common-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-2.29.9000-16.fc31.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "glibc-debuginfo-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-2.29.9000-16.fc31.src",
|
| |
+ requires=["glibc-debuginfo-common"])
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "glibc-2.29.9000-16.fc31.src",
|
| |
+ "glibc-2.29.9000-16.fc31.src")
|
| |
+
|
| |
+ mmd = self.cg.module.mmd()
|
| |
+ mmd = self.cg._fill_in_rpms_list(mmd, "x86_64")
|
| |
+
|
| |
+ assert set(mmd.get_rpm_artifacts().get()) == set([
|
| |
+ "glibc-common-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-2.29.9000-16.fc31.src",
|
| |
+ "glibc-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-debuginfo-common-2.29.9000-16.fc31.x86_64",
|
| |
+ "glibc-debuginfo-2.29.9000-16.fc31.x86_64"])
|
| |
+
|
| |
+ def test_fill_in_rpms_list_debuginfo_deps_kernel(self):
|
| |
+ self._add_test_rpm(
|
| |
+ "kernel-debuginfo-common-aarch64-5.0.9-301.fc30.aarch64",
|
| |
+ "kernel-5.0.9-301.fc30.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "kernel-debuginfo-5.0.9-301.fc30.aarch64",
|
| |
+ "kernel-5.0.9-301.fc30.src",
|
| |
+ requires=["kernel-debuginfo-common-aarch64"])
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "kernel-5.0.9-301.fc30.aarch64",
|
| |
+ "kernel-5.0.9-301.fc30.src")
|
| |
+
|
| |
+ self._add_test_rpm(
|
| |
+ "kernel-5.0.9-301.fc30.src",
|
| |
+ "kernel-5.0.9-301.fc30.src")
|
| |
+
|
| |
+ mmd = self.cg.module.mmd()
|
| |
+ mmd = self.cg._fill_in_rpms_list(mmd, "aarch64")
|
| |
+
|
| |
+ assert set(mmd.get_rpm_artifacts().get()) == set([
|
| |
+ "kernel-debuginfo-common-aarch64-5.0.9-301.fc30.aarch64",
|
| |
+ "kernel-5.0.9-301.fc30.src",
|
| |
+ "kernel-debuginfo-5.0.9-301.fc30.aarch64",
|
| |
+ "kernel-5.0.9-301.fc30.aarch64"])
|
| |
Our current code has following issues with -debuginfo/-debugsource handling:
foo-debuginfo
can requirebar-debuginfo
and we need to addbar-debuginfo
to the final MMD file even ifbar
is not added there.This is typical situation for
python-foo-debuginfo
which is requiredby
python2-foo-debuginfo
andpython3-foo-debuginfo
.python-foo-debugsource
needs to be added to final MMD file evenif there is no
python-foo
binary RPM, but onlypython-foo
SRPM.In this commit, this is fixed following way:
grouped_rpms
(which normally includes just thefoo
,foo-debuginfo
andfoo-debugsource
packages), we also add the packagesrequired by the
-debuginfo
and-debugsource
. This ensures that they are addedinto the final MMD list together.
-debugsource
subpackage with the name matching the SRPM name of its sourcepackage is marked to be included in a final MMD list together with SRPM. If the
-debugsource package name does not match the SPRM name, it is the -debugsource
built for normal binary RPM and this is case we are already handling even with
the current code.