| |
@@ -120,6 +120,37 @@
|
| |
]
|
| |
assert set(result) == set(expected)
|
| |
|
| |
+ @patch("module_build_service.builder.base.GenericBuilder.get_built_rpms_in_module_build")
|
| |
+ def test_resolve_requires(self, built_rpms):
|
| |
+ build = models.ModuleBuild.query.get(2)
|
| |
+ mmd = build.mmd()
|
| |
+ filter_list = Modulemd.SimpleSet()
|
| |
+ filter_list.add("foo")
|
| |
+ filter_list.add("bar")
|
| |
+ mmd.set_rpm_filter(filter_list)
|
| |
+ build.modulemd = mmd.dumps()
|
| |
+ db.session.commit()
|
| |
+
|
| |
+ built_rpms.return_value = [
|
| |
+ "foo-0:2.4.48-3.el8+1308+551bfa71",
|
| |
+ "foo-debuginfo-0:2.4.48-3.el8+1308+551bfa71",
|
| |
+ "bar-0:2.5.48-3.el8+1308+551bfa71",
|
| |
+ "bar-debuginfo-0:2.5.48-3.el8+1308+551bfa71",
|
| |
+ "x-0:2.5.48-3.el8+1308+551bfa71",
|
| |
+ "x-debuginfo-0:2.5.48-3.el8+1308+551bfa71"]
|
| |
+
|
| |
+ resolver = mbs_resolver.GenericResolver.create(tests.conf, backend='db')
|
| |
+ result = resolver.resolve_requires([":".join([
|
| |
+ build.name, build.stream, build.version, build.context])])
|
| |
+
|
| |
+ assert result == {
|
| |
+ 'testmodule': {
|
| |
+ 'stream': 'master', 'version': '20170109091357', 'context': u'78e4a6fd',
|
| |
+ 'ref': 'ff1ea79fc952143efeed1851aa0aa006559239ba',
|
| |
+ 'filtered_rpms': [
|
| |
+ 'foo-0:2.4.48-3.el8+1308+551bfa71',
|
| |
+ 'bar-0:2.5.48-3.el8+1308+551bfa71']}}
|
| |
+
|
| |
def test_resolve_profiles(self):
|
| |
"""
|
| |
Tests that the profiles get resolved recursively
|
| |
Previous code expected the MMD RPM filters to actually be component filters - that means the previous code expected component names like "httpd" there, but in fact, the MMD filter is RPM based, so there are RPM names of particular RPMs built from the component - like for example "httpd-debuginfo", "mod_ssl", "httpd-filesystem", ...
Because of that, the "Conflicts" section of module-build-macros did not contain all RPMs - it only contained those with same name as SRPM name from which they were built.
This PR fixes this by listing all the RPMs tagged in Koji tag of each (build-)required module and checking if the package is filtered by MMD filter section. If so, it stores it into the
filtered_rpms
as we did previously and it later gets added to Conflicts section of module-build-service.