summaryrefslogtreecommitdiff
path: root/cloudinit/tests/test_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/tests/test_util.py')
-rw-r--r--cloudinit/tests/test_util.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/cloudinit/tests/test_util.py b/cloudinit/tests/test_util.py
index f11cfb27..977ad8e0 100644
--- a/cloudinit/tests/test_util.py
+++ b/cloudinit/tests/test_util.py
@@ -200,6 +200,15 @@ OS_RELEASE_CLOUDLINUX_8 = dedent("""\
BUG_REPORT_URL="https://www.cloudlinux.com/support"
""")
+OS_RELEASE_OPENEULER_20 = dedent("""\
+ NAME="openEuler"
+ VERSION="20.03 (LTS-SP2)"
+ ID="openEuler"
+ VERSION_ID="20.03"
+ PRETTY_NAME="openEuler 20.03 (LTS-SP2)"
+ ANSI_COLOR="0;31"
+""")
+
REDHAT_RELEASE_CENTOS_6 = "CentOS release 6.10 (Final)"
REDHAT_RELEASE_CENTOS_7 = "CentOS Linux release 7.5.1804 (Core)"
REDHAT_RELEASE_REDHAT_6 = (
@@ -719,6 +728,14 @@ class TestGetLinuxDistro(CiTestCase):
self.assertEqual(('debian', '9', 'stretch'), dist)
@mock.patch('cloudinit.util.load_file')
+ def test_get_linux_openeuler(self, m_os_release, m_path_exists):
+ """Verify get the correct name and release name on Openeuler."""
+ m_os_release.return_value = OS_RELEASE_OPENEULER_20
+ m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists
+ dist = util.get_linux_distro()
+ self.assertEqual(('openEuler', '20.03', 'LTS-SP2'), dist)
+
+ @mock.patch('cloudinit.util.load_file')
def test_get_linux_opensuse(self, m_os_release, m_path_exists):
"""Verify we get the correct name and machine arch on openSUSE
prior to openSUSE Leap 15.