Set modulemd 'arch' field in arch-specific modulemd files imported to CG build.

This commit is contained in:
Jan Kaluza
2018-09-24 09:45:43 +02:00
parent e606840c47
commit f0cdb5030d
2 changed files with 5 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
# SOFTWARE.
#
# Written by Stanislav Ochotnicky <sochotnicky@redhat.com>
# Jan Kaluza <jkaluza@redhat.com>
import calendar
@@ -546,6 +547,8 @@ class KojiContentGenerator(object):
:return: Finalized modulemd string.
"""
mmd = self.module.mmd()
# Set the "Arch" field in mmd.
mmd.set_arch(pungi.arch.tree_arch_to_yum_arch(arch))
# Fill in the list of built RPMs.
mmd = self._fill_in_rpms_list(mmd, arch)

View File

@@ -180,10 +180,10 @@ class TestBuild:
assert len(mmd.read()) == 1134
with open(path.join(dir_path, "modulemd.x86_64.txt")) as mmd:
assert len(mmd.read()) == 242
assert len(mmd.read()) == 257
with open(path.join(dir_path, "modulemd.i686.txt")) as mmd:
assert len(mmd.read()) == 242
assert len(mmd.read()) == 255
@patch("module_build_service.builder.KojiContentGenerator.get_session")
def test_tag_cg_build(self, get_session):