LNX-286: Prepare pungi configuration and setup Jenkins job for AlmaLinux 8.4 beta

- The modules from a parsend output of FUS should be have a stream
  with replaced dash by underscore

@BS-NOBUILD
@BS-TARGET-CL8

Change-Id: If36d3d0a1ef8010bf85a4a0218b9838e0888453c
This commit is contained in:
stepan_oksanichenko 2021-04-26 23:18:29 +03:00
parent 305103a38e
commit ebf028ca3b
2 changed files with 13 additions and 3 deletions

View File

@ -83,5 +83,12 @@ def parse_output(output):
packages.add((name, arch, frozenset(flags)))
else:
name, arch = nevra.rsplit(".", 1)
modules.add(name.split(":", 1)[1])
# replace dash by underscore in stream of module's nerva
# source of name looks like
# module:llvm-toolset:rhel8:8040020210411062713:9f9e2e7e.x86_64
name = ':'.join(
item.replace('-', '_') if i == 1 else item for
i, item in enumerate(name.split(':')[1:])
)
modules.add(name)
return packages, modules

View File

@ -152,7 +152,10 @@ class TestParseOutput(unittest.TestCase):
self.assertEqual(modules, set())
def test_extracts_modules(self):
touch(self.file, "module:mod:master:20181003:cafebeef.x86_64@repo-0\n")
touch(
self.file,
"module:mod:master-1:20181003:cafebeef.x86_64@repo-0\n"
)
packages, modules = fus.parse_output(self.file)
self.assertEqual(packages, set())
self.assertEqual(modules, set(["mod:master:20181003:cafebeef"]))
self.assertEqual(modules, set(["mod:master_1:20181003:cafebeef"]))