Merge #962 Support the modulemd buildopts.rpms.whitelist option

This commit is contained in:
Matt Prahl
2018-06-27 11:42:49 +00:00
3 changed files with 24 additions and 5 deletions

2
Jenkinsfile vendored
View File

@@ -38,7 +38,7 @@ node('factory2'){
stage('Run Test Suite') {
timeout(20) {
onmyduffynode 'cd fm-orchestrator && docker run -v $PWD:/src:Z mbs/test'
onmyduffynode 'docker run -v ~/fm-orchestrator:/src:Z mbs/test'
}
}

View File

@@ -401,7 +401,8 @@ chmod 644 %buildroot/etc/rpm/macros.zz-modules
self.module_build_tag = self._koji_create_tag(
self.tag_name + "-build", self.arches, perm="admin")
self._koji_whitelist_packages(self.components)
self._koji_whitelist_packages(
self.mmd.props.buildopts.props.rpm_whitelist or self.components)
# If we have just created the build tag in this buildroot_connect call, block all
# the components in `blocked_packages` list. We want to do that just once, because

View File

@@ -413,7 +413,8 @@ class TestKojiBuilder:
assert weights == {"httpd": 1.5, "apr": 1.5}
@pytest.mark.parametrize('blocklist', [False, True])
def test_buildroot_connect(self, blocklist):
@pytest.mark.parametrize('custom_whitelist', [False, True])
def test_buildroot_connect(self, custom_whitelist, blocklist):
if blocklist:
mmd = self.module.mmd()
xmd = glib.from_variant_dict(mmd.get_xmd())
@@ -421,6 +422,13 @@ class TestKojiBuilder:
mmd.set_xmd(glib.dict_values(xmd))
self.module.modulemd = mmd.dumps()
if custom_whitelist:
mmd = self.module.mmd()
opts = mmd.get_buildopts()
opts.set_rpm_whitelist(['custom1', 'custom2'])
mmd.set_buildopts(opts)
self.module.modulemd = mmd.dumps()
builder = FakeKojiModuleBuilder(
owner=self.module.owner, module=self.module, config=conf, tag_name='module-foo',
components=["nginx"])
@@ -431,8 +439,18 @@ class TestKojiBuilder:
groups['srpm-build'] = set(["fedora-release"])
builder.buildroot_connect(groups)
expected_calls = [mock.call('module-foo', 'nginx', u'Moe Szyslak'),
mock.call('module-foo-build', 'nginx', u'Moe Szyslak')]
if custom_whitelist:
expected_calls = [
mock.call('module-foo', 'custom1', 'Moe Szyslak'),
mock.call('module-foo', 'custom2', 'Moe Szyslak'),
mock.call('module-foo-build', 'custom1', 'Moe Szyslak'),
mock.call('module-foo-build', 'custom2', 'Moe Szyslak')
]
else:
expected_calls = [
mock.call('module-foo', 'nginx', 'Moe Szyslak'),
mock.call('module-foo-build', 'nginx', 'Moe Szyslak')
]
assert session.packageListAdd.mock_calls == expected_calls
expected_calls = [mock.call('module-foo-build', 'build'),