From: Kyrylo Shatskyy Date: Sat, 25 Oct 2025 00:37:14 +0000 (+0200) Subject: packaging: fix test for distro version X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=51071c8553c5857ae5d55905b1f0daa9bbdd1bb8;p=teuthology.git packaging: fix test for distro version Signed-off-by: Kyrylo Shatskyy --- diff --git a/teuthology/packaging.py b/teuthology/packaging.py index b4734d062..3ae8d6a11 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -571,7 +571,7 @@ class GitbuilderProject(object): def _get_dist_release(self): version = self._parse_version(self.os_version) - if self.os_type in ('centos', 'rhel', 'rocky'): + if self.os_type in ('centos', 'rhel', 'alma', 'rocky'): return "el{0}".format(version) elif self.os_type == "fedora": return "fc{0}".format(version) @@ -602,14 +602,12 @@ class GitbuilderProject(object): """ if distro in ('centos', 'rhel'): distro = "centos" - elif distro == "fedora": - distro = "fedora" - elif distro == "opensuse": - distro = "opensuse" - elif distro == "sle": - distro == "sle" - elif distro == "rocky": - distro = "rocky" + elif distro in ("fedora"): + pass + elif distro in ("opensuse", "sle"): + pass + elif distro in ("alma", "rocky"): + pass else: # deb based systems use codename instead of a distro/version combo if not codename: @@ -943,8 +941,7 @@ class ShamanProject(GitbuilderProject): if distro in ('centos', 'rhel'): distro = 'centos' version = cls._parse_version(version) - if distro in ('rocky'): - distro = 'rocky' + if distro in ('alma', 'rocky'): version = cls._parse_version(version) return "%s/%s" % (distro, version) diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index 265b2f8cf..5b5204b91 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -768,6 +768,9 @@ class TestShamanProject(TestBuilderProject): DISTRO_MATRIX = [ ('rhel', '7.0', None, 'centos/7'), + ('alma', '9.6', None, 'alma/9'), + ('rocky', '9.6', None, 'rocky/9'), + ('rocky', '10.0', None, 'rocky/10'), ('centos', '6.5', None, 'centos/6'), ('centos', '7.0', None, 'centos/7'), ('centos', '7.1', None, 'centos/7'), @@ -783,12 +786,27 @@ class TestShamanProject(TestBuilderProject): ('ubuntu', '16.04', None, 'ubuntu/16.04'), ('ubuntu', '18.04', None, 'ubuntu/18.04'), ('ubuntu', '20.04', None, 'ubuntu/20.04'), + ('opensuse', '15.6', None, 'opensuse/15.6'), + ('sle', '15.5', None, 'sle/15.5'), ] + @pytest.mark.parametrize( + "matrix_index", + range(len(DISTRO_MATRIX)), + ) + def test_get_distro_remote(self, matrix_index): + super().test_get_distro_remote(matrix_index) DISTRO_MATRIX_NOVER = [ ('rhel', None, None, 'centos/8'), - ('centos', None, None, 'centos/8'), + ('centos', None, None, 'centos/9'), ('fedora', None, None, 'fedora/25'), - ('ubuntu', None, None, 'ubuntu/20.04'), - ('debian', None, None, 'debian/8.0'), + ('ubuntu', None, None, 'ubuntu/22.04'), + ('alma', None, None, 'alma/9'), + ('rocky', None, None, 'rocky/9'), ] + @pytest.mark.parametrize( + "matrix_index", + range(len(DISTRO_MATRIX) + len(DISTRO_MATRIX_NOVER)), + ) + def test_get_distro_config(self, matrix_index): + super().test_get_distro_config(matrix_index)