]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
tests: Add test for parsing Centos 9 os_release
authorZack Cerza <zack@redhat.com>
Tue, 4 Jun 2024 19:48:35 +0000 (13:48 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 4 Jun 2024 19:48:35 +0000 (13:48 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/orchestra/test/test_opsys.py

index c8f6e0bd3d65f91d67d911b20c9e5278c7c249bc..4be890dab2924d49955c8ca07fa30cbc6e541f9c 100644 (file)
@@ -4,6 +4,23 @@ import pytest
 
 
 class TestOS(object):
+    str_centos_9_os_release = dedent("""
+        NAME="CentOS Stream"
+        VERSION="9"
+        ID="centos"
+        ID_LIKE="rhel fedora"
+        VERSION_ID="9"
+        PLATFORM_ID="platform:el9"
+        PRETTY_NAME="CentOS Stream 9"
+        ANSI_COLOR="0;31"
+        LOGO="fedora-logo-icon"
+        CPE_NAME="cpe:/o:centos:centos:9"
+        HOME_URL="https://centos.org/"
+        BUG_REPORT_URL="https://issues.redhat.com/"
+        REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 9"
+        REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
+    """)
+
     str_centos_7_os_release = dedent("""
         NAME="CentOS Linux"
         VERSION="7 (Core)"
@@ -235,6 +252,13 @@ class TestOS(object):
         HOME_URL="https://www.opensuse.org/"
     """)
 
+    def test_centos_9_os_release(self):
+        os = OS.from_os_release(self.str_centos_9_os_release)
+        assert os.name == 'centos'
+        assert os.version == '9'
+        assert os.codename == 'stream'
+        assert os.package_type == 'rpm'
+
     def test_centos_7_os_release(self):
         os = OS.from_os_release(self.str_centos_7_os_release)
         assert os.name == 'centos'