summaryrefslogtreecommitdiff
path: root/cloudinit/tests
diff options
context:
space:
mode:
authorAleksander Baranowski <aleksander.baranowski@yahoo.pl>2021-08-05 18:32:36 +0200
committerGitHub <noreply@github.com>2021-08-05 11:32:36 -0500
commit3d9c862b6ded798031fad827328fa437bc14ac97 (patch)
tree8de4fae6a64e05f95329baaf51dd384a6baf59d3 /cloudinit/tests
parent758acf976f2cb67a85411467fa5fca2ea17a2283 (diff)
downloadvyos-cloud-init-3d9c862b6ded798031fad827328fa437bc14ac97.tar.gz
vyos-cloud-init-3d9c862b6ded798031fad827328fa437bc14ac97.zip
Add support for EuroLinux 7 && EuroLinux 8 (#957)
Diffstat (limited to 'cloudinit/tests')
-rw-r--r--cloudinit/tests/.test_util.py.swpbin16384 -> 0 bytes
-rw-r--r--cloudinit/tests/test_util.py66
2 files changed, 66 insertions, 0 deletions
diff --git a/cloudinit/tests/.test_util.py.swp b/cloudinit/tests/.test_util.py.swp
deleted file mode 100644
index 78ef5865..00000000
--- a/cloudinit/tests/.test_util.py.swp
+++ /dev/null
Binary files differ
diff --git a/cloudinit/tests/test_util.py b/cloudinit/tests/test_util.py
index bd7720d1..9dd01158 100644
--- a/cloudinit/tests/test_util.py
+++ b/cloudinit/tests/test_util.py
@@ -124,6 +124,38 @@ OS_RELEASE_ALMALINUX_8 = dedent("""\
ALMALINUX_MANTISBT_PROJECT_VERSION="8.3"
""")
+OS_RELEASE_EUROLINUX_7 = dedent("""\
+ VERSION="7.9 (Minsk)"
+ ID="eurolinux"
+ ID_LIKE="rhel scientific centos fedora"
+ VERSION_ID="7.9"
+ PRETTY_NAME="EuroLinux 7.9 (Minsk)"
+ ANSI_COLOR="0;31"
+ CPE_NAME="cpe:/o:eurolinux:eurolinux:7.9:GA"
+ HOME_URL="http://www.euro-linux.com/"
+ BUG_REPORT_URL="mailto:support@euro-linux.com"
+ REDHAT_BUGZILLA_PRODUCT="EuroLinux 7"
+ REDHAT_BUGZILLA_PRODUCT_VERSION=7.9
+ REDHAT_SUPPORT_PRODUCT="EuroLinux"
+ REDHAT_SUPPORT_PRODUCT_VERSION="7.9"
+""")
+
+OS_RELEASE_EUROLINUX_8 = dedent("""\
+ NAME="EuroLinux"
+ VERSION="8.4 (Vaduz)"
+ ID="eurolinux"
+ ID_LIKE="rhel fedora centos"
+ VERSION_ID="8.4"
+ PLATFORM_ID="platform:el8"
+ PRETTY_NAME="EuroLinux 8.4 (Vaduz)"
+ ANSI_COLOR="0;34"
+ CPE_NAME="cpe:/o:eurolinux:eurolinux:8"
+ HOME_URL="https://www.euro-linux.com/"
+ BUG_REPORT_URL="https://github.com/EuroLinux/eurolinux-distro-bugs-and-rfc/"
+ REDHAT_SUPPORT_PRODUCT="EuroLinux"
+ REDHAT_SUPPORT_PRODUCT_VERSION="8"
+""")
+
OS_RELEASE_ROCKY_8 = dedent("""\
NAME="Rocky Linux"
VERSION="8.3 (Green Obsidian)"
@@ -162,6 +194,8 @@ REDHAT_RELEASE_REDHAT_7 = (
"Red Hat Enterprise Linux Server release 7.5 (Maipo)")
REDHAT_RELEASE_ALMALINUX_8 = (
"AlmaLinux release 8.3 (Purple Manul)")
+REDHAT_RELEASE_EUROLINUX_7 = "EuroLinux release 7.9 (Minsk)"
+REDHAT_RELEASE_EUROLINUX_8 = "EuroLinux release 8.4 (Vaduz)"
REDHAT_RELEASE_ROCKY_8 = (
"Rocky Linux release 8.3 (Green Obsidian)")
REDHAT_RELEASE_VIRTUOZZO_8 = (
@@ -582,6 +616,38 @@ class TestGetLinuxDistro(CiTestCase):
self.assertEqual(('almalinux', '8.3', 'Purple Manul'), dist)
@mock.patch('cloudinit.util.load_file')
+ def test_get_linux_eurolinux7_rhrelease(self, m_os_release, m_path_exists):
+ """Verify eurolinux 7 read from redhat-release."""
+ m_os_release.return_value = REDHAT_RELEASE_EUROLINUX_7
+ m_path_exists.side_effect = TestGetLinuxDistro.redhat_release_exists
+ dist = util.get_linux_distro()
+ self.assertEqual(('eurolinux', '7.9', 'Minsk'), dist)
+
+ @mock.patch('cloudinit.util.load_file')
+ def test_get_linux_eurolinux7_osrelease(self, m_os_release, m_path_exists):
+ """Verify eurolinux 7 read from os-release."""
+ m_os_release.return_value = OS_RELEASE_EUROLINUX_7
+ m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists
+ dist = util.get_linux_distro()
+ self.assertEqual(('eurolinux', '7.9', 'Minsk'), dist)
+
+ @mock.patch('cloudinit.util.load_file')
+ def test_get_linux_eurolinux8_rhrelease(self, m_os_release, m_path_exists):
+ """Verify eurolinux 8 read from redhat-release."""
+ m_os_release.return_value = REDHAT_RELEASE_EUROLINUX_8
+ m_path_exists.side_effect = TestGetLinuxDistro.redhat_release_exists
+ dist = util.get_linux_distro()
+ self.assertEqual(('eurolinux', '8.4', 'Vaduz'), dist)
+
+ @mock.patch('cloudinit.util.load_file')
+ def test_get_linux_eurolinux8_osrelease(self, m_os_release, m_path_exists):
+ """Verify eurolinux 8 read from os-release."""
+ m_os_release.return_value = OS_RELEASE_EUROLINUX_8
+ m_path_exists.side_effect = TestGetLinuxDistro.os_release_exists
+ dist = util.get_linux_distro()
+ self.assertEqual(('eurolinux', '8.4', 'Vaduz'), dist)
+
+ @mock.patch('cloudinit.util.load_file')
def test_get_linux_rocky8_rhrelease(self, m_os_release, m_path_exists):
"""Verify rocky linux 8 read from redhat-release."""
m_os_release.return_value = REDHAT_RELEASE_ROCKY_8