49 lines
1.9 KiB
Diff
49 lines
1.9 KiB
Diff
From 7289e616a836fe0f1c97388f40e5d4916804ae91 Mon Sep 17 00:00:00 2001
|
|
From: Paula Gombar <gombarica@gmail.com>
|
|
Date: Wed, 2 Dec 2020 21:36:41 -0800
|
|
Subject: Fix distro resolution for RedHat (#2083)
|
|
|
|
vkuznets: cherry-picking the primary change of the commit (adding 'rhel')
|
|
only, pylint changes require additional commits.
|
|
|
|
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
---
|
|
tests/common/osutil/test_factory.py | 14 ++++++++++++++
|
|
1 file changed, 14 insertions(+)
|
|
|
|
diff --git a/tests/common/osutil/test_factory.py b/tests/common/osutil/test_factory.py
|
|
index f7d46b21..c48dd17f 100644
|
|
--- a/tests/common/osutil/test_factory.py
|
|
+++ b/tests/common/osutil/test_factory.py
|
|
@@ -195,6 +195,13 @@ class TestOsUtilFactory(AgentTestCase):
|
|
self.assertTrue(isinstance(ret, Redhat6xOSUtil))
|
|
self.assertEqual(ret.get_service_name(), "waagent")
|
|
|
|
+ ret = _get_osutil(distro_name="rhel",
|
|
+ distro_code_name="",
|
|
+ distro_full_name="",
|
|
+ distro_version="6")
|
|
+ self.assertTrue(type(ret) == Redhat6xOSUtil)
|
|
+ self.assertEquals(ret.get_service_name(), "waagent")
|
|
+
|
|
ret = _get_osutil(distro_name="centos",
|
|
distro_code_name="",
|
|
distro_full_name="",
|
|
@@ -223,6 +230,13 @@ class TestOsUtilFactory(AgentTestCase):
|
|
self.assertTrue(isinstance(ret, RedhatOSUtil))
|
|
self.assertEqual(ret.get_service_name(), "waagent")
|
|
|
|
+ ret = _get_osutil(distro_name="rhel",
|
|
+ distro_code_name="",
|
|
+ distro_full_name="",
|
|
+ distro_version="7")
|
|
+ self.assertTrue(type(ret) == RedhatOSUtil)
|
|
+ self.assertEquals(ret.get_service_name(), "waagent")
|
|
+
|
|
ret = _get_osutil(distro_name="centos",
|
|
distro_code_name="",
|
|
distro_full_name="",
|
|
--
|
|
2.27.0
|
|
|