test/integration: properly match distro to host

When we are on an RHEL 8.x host we need to supply `rhel-8x` as
target distro. The previous code just used the major version so
we always built `rhel-8`, i.e. RHEL 8.3.
This commit is contained in:
Christian Kellner 2022-02-15 12:22:23 +00:00 committed by Achilleas Koutsou
parent 30f11bcf16
commit 5d2f6c6daa

View file

@ -83,9 +83,12 @@ class TestIntegration(unittest.TestCase):
name = info["ID"] # 'fedora' or 'rhel' name = info["ID"] # 'fedora' or 'rhel'
version = info["VERSION_ID"] # <major> or <major>.<minor> version = info["VERSION_ID"] # <major> or <major>.<minor>
major = version.split(".")[0]
distro = f"{name}-{major}" comps = version.split(".")
major = comps[0]
minor = comps[1] if len(comps) > 1 else ""
distro = f"{name}-{major}{minor}"
tag = f"{name}{major}-candidate" # fedora<major> or rhel<major> tag = f"{name}{major}-candidate" # fedora<major> or rhel<major>
arch = platform.machine() arch = platform.machine()