ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically
- Unittests are fixed
This commit is contained in:
parent
943fd8e77d
commit
6592735aec
@ -15,10 +15,13 @@ class TestGatherRpms(TestCase):
|
|||||||
maxDiff = None
|
maxDiff = None
|
||||||
|
|
||||||
FILES_TO_CREATE = [
|
FILES_TO_CREATE = [
|
||||||
'powertools/Packages/libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686.rpm',
|
'powertools/Packages/libvirt-6.0.0-28.module_el'
|
||||||
|
'8.3.0+555+a55c8938.i686.rpm',
|
||||||
'powertools/Packages/libgit2-devel-0.26.8-2.el8.x86_64.rpm',
|
'powertools/Packages/libgit2-devel-0.26.8-2.el8.x86_64.rpm',
|
||||||
'powertools/Packages/xalan-j2-2.7.1-38.module_el8.0.0+30+832da3a1.noarch.rpm',
|
'powertools/Packages/xalan-j2-2.7.1-38.module_el'
|
||||||
'appstream/Packages/bnd-maven-plugin-3.5.0-4.module_el8.0.0+30+832da3a1.noarch.rpm',
|
'8.0.0+30+832da3a1.noarch.rpm',
|
||||||
|
'appstream/Packages/bnd-maven-plugin-3.5.0-4.module_el'
|
||||||
|
'8.0.0+30+832da3a1.noarch.rpm',
|
||||||
'appstream/Packages/OpenEXR-devel-2.2.0-11.el8.i686.rpm',
|
'appstream/Packages/OpenEXR-devel-2.2.0-11.el8.i686.rpm',
|
||||||
'appstream/Packages/mingw-binutils-generic-2.30-1.el8.x86_64.rpm',
|
'appstream/Packages/mingw-binutils-generic-2.30-1.el8.x86_64.rpm',
|
||||||
'appstream/Packages/somenonrpm',
|
'appstream/Packages/somenonrpm',
|
||||||
@ -30,30 +33,51 @@ class TestGatherRpms(TestCase):
|
|||||||
os.makedirs(PATH_TO_REPOS)
|
os.makedirs(PATH_TO_REPOS)
|
||||||
|
|
||||||
for filepath in self.FILES_TO_CREATE:
|
for filepath in self.FILES_TO_CREATE:
|
||||||
os.makedirs(os.path.join(PATH_TO_REPOS, os.path.dirname(filepath)), exist_ok=True)
|
os.makedirs(
|
||||||
|
os.path.join(PATH_TO_REPOS, os.path.dirname(filepath)),
|
||||||
|
exist_ok=True,
|
||||||
|
)
|
||||||
open(os.path.join(PATH_TO_REPOS, filepath), 'w').close()
|
open(os.path.join(PATH_TO_REPOS, filepath), 'w').close()
|
||||||
|
|
||||||
def test_gather_rpms(self):
|
def test_gather_rpms(self):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
[Package(nvra='libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686',
|
[Package(nvra='libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686',
|
||||||
path=f'{PATH_TO_REPOS}/powertools/Packages/'
|
path=Path(
|
||||||
f'libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686.rpm'),
|
f'{PATH_TO_REPOS}/powertools/Packages/'
|
||||||
|
f'libvirt-6.0.0-28.module_el'
|
||||||
|
f'8.3.0+555+a55c8938.i686.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='libgit2-devel-0.26.8-2.el8.x86_64',
|
Package(nvra='libgit2-devel-0.26.8-2.el8.x86_64',
|
||||||
path=f'{PATH_TO_REPOS}/powertools/Packages/'
|
path=Path(
|
||||||
f'libgit2-devel-0.26.8-2.el8.x86_64.rpm'),
|
f'{PATH_TO_REPOS}/powertools/Packages/'
|
||||||
Package(nvra='xalan-j2-2.7.1-38.module_el8.0.0+30+832da3a1.noarch',
|
f'libgit2-devel-0.26.8-2.el8.x86_64.rpm'
|
||||||
path=f'{PATH_TO_REPOS}/powertools/Packages/'
|
)),
|
||||||
f'xalan-j2-2.7.1-38.module_el8.0.0+30+832da3a1.noarch.rpm'),
|
Package(nvra='xalan-j2-2.7.1-38.module_el'
|
||||||
Package(nvra='bnd-maven-plugin-3.5.0-4.module_el8.0.0+30+832da3a1.noarch',
|
'8.0.0+30+832da3a1.noarch',
|
||||||
path='/path/to/repos/appstream/Packages/'
|
path=Path(
|
||||||
'bnd-maven-plugin-3.5.0-4.module_el8.0.0+30+832da3a1.noarch.rpm'),
|
f'{PATH_TO_REPOS}/powertools/Packages/'
|
||||||
|
f'xalan-j2-2.7.1-38.module_el'
|
||||||
|
f'8.0.0+30+832da3a1.noarch.rpm'
|
||||||
|
)),
|
||||||
|
Package(nvra='bnd-maven-plugin-3.5.0-4.module_el'
|
||||||
|
'8.0.0+30+832da3a1.noarch',
|
||||||
|
path=Path(
|
||||||
|
'/path/to/repos/appstream/Packages/'
|
||||||
|
'bnd-maven-plugin-3.5.0-4.module_el'
|
||||||
|
'8.0.0+30+832da3a1.noarch.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='OpenEXR-devel-2.2.0-11.el8.i686',
|
Package(nvra='OpenEXR-devel-2.2.0-11.el8.i686',
|
||||||
path=f'{PATH_TO_REPOS}/appstream/Packages/'
|
path=Path(
|
||||||
f'OpenEXR-devel-2.2.0-11.el8.i686.rpm'),
|
f'{PATH_TO_REPOS}/appstream/Packages/'
|
||||||
|
f'OpenEXR-devel-2.2.0-11.el8.i686.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='mingw-binutils-generic-2.30-1.el8.x86_64',
|
Package(nvra='mingw-binutils-generic-2.30-1.el8.x86_64',
|
||||||
path=f'{PATH_TO_REPOS}/appstream/Packages/'
|
path=Path(
|
||||||
f'mingw-binutils-generic-2.30-1.el8.x86_64.rpm')],
|
f'{PATH_TO_REPOS}/appstream/Packages/'
|
||||||
search_rpms(PATH_TO_REPOS)
|
f'mingw-binutils-generic-2.30-1.el8.x86_64.rpm'
|
||||||
|
))
|
||||||
|
],
|
||||||
|
search_rpms(Path(PATH_TO_REPOS))
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_copy_rpms(self):
|
def test_copy_rpms(self):
|
||||||
@ -61,23 +85,39 @@ class TestGatherRpms(TestCase):
|
|||||||
packages = [
|
packages = [
|
||||||
|
|
||||||
Package(nvra='libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686',
|
Package(nvra='libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686',
|
||||||
path=f'{PATH_TO_REPOS}/powertools/Packages/'
|
path=Path(
|
||||||
f'libvirt-6.0.0-28.module_el8.3.0+555+a55c8938.i686.rpm'),
|
f'{PATH_TO_REPOS}/powertools/Packages/'
|
||||||
|
f'libvirt-6.0.0-28.module_el'
|
||||||
|
f'8.3.0+555+a55c8938.i686.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='libgit2-devel-0.26.8-2.el8.x86_64',
|
Package(nvra='libgit2-devel-0.26.8-2.el8.x86_64',
|
||||||
path=f'{PATH_TO_REPOS}/powertools/Packages/'
|
path=Path(
|
||||||
f'libgit2-devel-0.26.8-2.el8.x86_64.rpm'),
|
f'{PATH_TO_REPOS}/powertools/Packages/'
|
||||||
|
f'libgit2-devel-0.26.8-2.el8.x86_64.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='xalan-j2-2.7.1-38.module_el8.0.0+30+832da3a1.noarch',
|
Package(nvra='xalan-j2-2.7.1-38.module_el8.0.0+30+832da3a1.noarch',
|
||||||
path=f'{PATH_TO_REPOS}/powertools/Packages/'
|
path=Path(
|
||||||
f'xalan-j2-2.7.1-38.module_el8.0.0+30+832da3a1.noarch.rpm'),
|
f'{PATH_TO_REPOS}/powertools/Packages/'
|
||||||
Package(nvra='bnd-maven-plugin-3.5.0-4.module_el8.0.0+30+832da3a1.noarch',
|
f'xalan-j2-2.7.1-38.module_el'
|
||||||
path='/path/to/repos/appstream/Packages/'
|
f'8.0.0+30+832da3a1.noarch.rpm'
|
||||||
'bnd-maven-plugin-3.5.0-4.module_el8.0.0+30+832da3a1.noarch.rpm'),
|
)),
|
||||||
|
Package(nvra='bnd-maven-plugin-3.5.0-4.module_el'
|
||||||
|
'8.0.0+30+832da3a1.noarch',
|
||||||
|
path=Path(
|
||||||
|
'/path/to/repos/appstream/Packages/'
|
||||||
|
'bnd-maven-plugin-3.5.0-4.module_el'
|
||||||
|
'8.0.0+30+832da3a1.noarch.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='OpenEXR-devel-2.2.0-11.el8.i686',
|
Package(nvra='OpenEXR-devel-2.2.0-11.el8.i686',
|
||||||
path=f'{PATH_TO_REPOS}/appstream/Packages/'
|
path=Path(
|
||||||
f'OpenEXR-devel-2.2.0-11.el8.i686.rpm'),
|
f'{PATH_TO_REPOS}/appstream/Packages/'
|
||||||
|
f'OpenEXR-devel-2.2.0-11.el8.i686.rpm'
|
||||||
|
)),
|
||||||
Package(nvra='mingw-binutils-generic-2.30-1.el8.x86_64',
|
Package(nvra='mingw-binutils-generic-2.30-1.el8.x86_64',
|
||||||
path=f'{PATH_TO_REPOS}/appstream/Packages/'
|
path=Path(
|
||||||
f'mingw-binutils-generic-2.30-1.el8.x86_64.rpm')
|
f'{PATH_TO_REPOS}/appstream/Packages/'
|
||||||
|
f'mingw-binutils-generic-2.30-1.el8.x86_64.rpm'
|
||||||
|
))
|
||||||
]
|
]
|
||||||
copy_rpms(packages, target_path)
|
copy_rpms(packages, target_path)
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ class TestKojiPkgset(PkgsetCompareMixin, helpers.PungiTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
figure = re.compile(
|
figure = re.compile(
|
||||||
r"^RPM\(s\) not found for sigs: .+Check log for details.+bash-4\.3\.42-4\.fc24.+bash-debuginfo-4\.3\.42-4\.fc24$", # noqa: E501
|
r"^RPM\(s\) not found for sigs: .+Check log for details.+bash-4\.3\.42-4\.fc24\.x86_64.+bash-debuginfo-4\.3\.42-4\.fc24\.x86_64$", # noqa: E501
|
||||||
re.DOTALL,
|
re.DOTALL,
|
||||||
)
|
)
|
||||||
self.assertRegex(str(ctx.exception), figure)
|
self.assertRegex(str(ctx.exception), figure)
|
||||||
@ -399,7 +399,7 @@ class TestKojiPkgset(PkgsetCompareMixin, helpers.PungiTestCase):
|
|||||||
pkgset.raise_invalid_sigkeys_exception(pkgset.invalid_sigkey_rpms)
|
pkgset.raise_invalid_sigkeys_exception(pkgset.invalid_sigkey_rpms)
|
||||||
|
|
||||||
figure = re.compile(
|
figure = re.compile(
|
||||||
r"^RPM\(s\) not found for sigs: .+Check log for details.+bash-4\.3\.42-4\.fc24.+bash-debuginfo-4\.3\.42-4\.fc24$", # noqa: E501
|
r"^RPM\(s\) not found for sigs: .+Check log for details.+bash-4\.3\.42-4\.fc24\.x86_64.+bash-debuginfo-4\.3\.42-4\.fc24\.x86_64$", # noqa: E501
|
||||||
re.DOTALL,
|
re.DOTALL,
|
||||||
)
|
)
|
||||||
self.assertRegex(str(ctx.exception), figure)
|
self.assertRegex(str(ctx.exception), figure)
|
||||||
|
Loading…
Reference in New Issue
Block a user