|
124 | 124 | ALMALINUX_MANTISBT_PROJECT_VERSION="8.3" |
125 | 125 | """) |
126 | 126 |
|
| 127 | +OS_RELEASE_ROCKY_8 = dedent("""\ |
| 128 | + NAME="Rocky Linux" |
| 129 | + VERSION="8.3 (Green Obsidian)" |
| 130 | + ID="rocky" |
| 131 | + ID_LIKE="rhel fedora" |
| 132 | + VERSION_ID="8.3" |
| 133 | + PLATFORM_ID="platform:el8" |
| 134 | + PRETTY_NAME="Rocky Linux 8.3 (Green Obsidian)" |
| 135 | + ANSI_COLOR="0;31" |
| 136 | + CPE_NAME="cpe:/o:rocky:rocky:8" |
| 137 | + HOME_URL="https://rockylinux.org/" |
| 138 | + BUG_REPORT_URL="https://bugs.rockylinux.org/" |
| 139 | + ROCKY_SUPPORT_PRODUCT="Rocky Linux" |
| 140 | + ROCKY_SUPPORT_PRODUCT_VERSION="8" |
| 141 | +""") |
| 142 | + |
127 | 143 | REDHAT_RELEASE_CENTOS_6 = "CentOS release 6.10 (Final)" |
128 | 144 | REDHAT_RELEASE_CENTOS_7 = "CentOS Linux release 7.5.1804 (Core)" |
129 | 145 | REDHAT_RELEASE_REDHAT_6 = ( |
|
132 | 148 | "Red Hat Enterprise Linux Server release 7.5 (Maipo)") |
133 | 149 | REDHAT_RELEASE_ALMALINUX_8 = ( |
134 | 150 | "AlmaLinux release 8.3 (Purple Manul)") |
135 | | - |
| 151 | +REDHAT_RELEASE_ROCKY_8 = ( |
| 152 | + "Rocky Linux release 8.3 (Green Obsidian)") |
136 | 153 |
|
137 | 154 | OS_RELEASE_DEBIAN = dedent("""\ |
138 | 155 | PRETTY_NAME="Debian GNU/Linux 9 (stretch)" |
@@ -537,6 +554,22 @@ def test_get_linux_almalinux8_osrelease(self, m_os_release, m_path_exists): |
537 | 554 | dist = util.get_linux_distro() |
538 | 555 | self.assertEqual(('almalinux', '8.3', 'Purple Manul'), dist) |
539 | 556 |
|
| 557 | + @mock.patch('cloudinit.util.load_file') |
| 558 | + def test_get_linux_rocky8_rhrelease(self, m_os_release, m_path_exists): |
| 559 | + """Verify rocky linux 8 read from redhat-release.""" |
| 560 | + m_os_release.return_value = REDHAT_RELEASE_ROCKY_8 |
| 561 | + m_path_exists.side_effect = TestGetLinuxDistro.redhat_release_exists |
| 562 | + dist = util.get_linux_distro() |
| 563 | + self.assertEqual(('rocky', '8.3', 'Green Obsidian'), dist) |
| 564 | + |
| 565 | + @mock.patch('cloudinit.util.load_file') |
| 566 | + def test_get_linux_rocky8_osrelease(self, m_os_release, m_path_exists): |
| 567 | + """Verify rocky linux 8 read from os-release.""" |
| 568 | + m_os_release.return_value = OS_RELEASE_ROCKY_8 |
| 569 | + m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists |
| 570 | + dist = util.get_linux_distro() |
| 571 | + self.assertEqual(('rocky', '8.3', 'Green Obsidian'), dist) |
| 572 | + |
540 | 573 | @mock.patch('cloudinit.util.load_file') |
541 | 574 | def test_get_linux_debian(self, m_os_release, m_path_exists): |
542 | 575 | """Verify we get the correct name and release name on Debian.""" |
|
0 commit comments