]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
packaging: fix test for distro version
authorKyrylo Shatskyy <kyrylo.shatskyy@gmail.com>
Sat, 25 Oct 2025 00:37:14 +0000 (02:37 +0200)
committerKyrylo Shatskyy <kyrylo.shatskyy@gmail.com>
Sat, 25 Oct 2025 00:37:14 +0000 (02:37 +0200)
Signed-off-by: Kyrylo Shatskyy <kyrylo.shatskyy@clyso.com>
teuthology/packaging.py
teuthology/test/test_packaging.py

index b4734d06206850a36fdf83a83dc8b3eaed8c4288..3ae8d6a1182255f9942a16f1f3f0d8e1827a08d7 100644 (file)
@@ -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)
 
index 265b2f8cfab060ced9cbfa3715c10ee5e39db4da..5b5204b91ea2ef1faabe7ec645a9a4584482d585 100644 (file)
@@ -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)