From 53443c5c712f4ec23b859105e94bcd90abc27762 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 9 Mar 2020 17:44:54 +0100 Subject: Remove support for CentOS 7 With the move to RHEL/CentOS 8 we no longer have Python 2 in our images so there is no need for checking which Python version (2.x or 3.x) is used inside of containers. We also no longer have to support yum as a value for distro_package_manager. Partially-Implements: blueprint centos-rhel-8 Change-Id: Ie45cf3465fedddbde7856961527421883ba3d5c9 --- kolla/tests/test_build.py | 29 ++++------------------------- kolla/tests/test_methods.py | 18 ++++++------------ 2 files changed, 10 insertions(+), 37 deletions(-) (limited to 'kolla/tests') diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index 1b633de4c..ad5e47600 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -551,19 +551,12 @@ class KollaWorkerTest(base.TestCase): kolla = build.KollaWorker(self.conf) self.assertEqual('3.6', kolla.distro_python_version) - def test_build_distro_python_version_centos7(self): - """check distro_python_version for CentOS 7.6.1810""" + def test_build_distro_python_version_centos(self): + """check distro_python_version for CentOS 8.0.1905""" self.conf.set_override('base', 'centos') - self.conf.set_override('base_tag', '7.6.1810') + self.conf.set_override('base_tag', '8.0.1905') kolla = build.KollaWorker(self.conf) - self.assertEqual('2.7', kolla.distro_python_version) - - def test_build_distro_python_version_rhel7(self): - """check distro_python_version for RHEL7""" - self.conf.set_override('base', 'rhel') - self.conf.set_override('base_tag', '7') - kolla = build.KollaWorker(self.conf) - self.assertEqual('2.7', kolla.distro_python_version) + self.assertEqual('3.6', kolla.distro_python_version) def test_build_distro_package_manager(self): """check distro_package_manager conf value is taken""" @@ -585,20 +578,6 @@ class KollaWorkerTest(base.TestCase): kolla = build.KollaWorker(self.conf) self.assertEqual('dnf', kolla.distro_package_manager) - def test_build_distro_package_manager_rhel7(self): - """check distro_package_manager yum for rhel7""" - self.conf.set_override('base', 'rhel') - self.conf.set_override('base_tag', '7') - kolla = build.KollaWorker(self.conf) - self.assertEqual('yum', kolla.distro_package_manager) - - def test_build_distro_package_manager_rhel7_minor(self): - """check distro_package_manager yum for rhel7""" - self.conf.set_override('base', 'rhel') - self.conf.set_override('base_tag', '7.6.1801') - kolla = build.KollaWorker(self.conf) - self.assertEqual('yum', kolla.distro_package_manager) - def test_build_distro_package_manager_debian(self): """check distro_package_manager apt for debian""" self.conf.set_override('base', 'debian') diff --git a/kolla/tests/test_methods.py b/kolla/tests/test_methods.py index c33aba7f9..d2f6ac283 100644 --- a/kolla/tests/test_methods.py +++ b/kolla/tests/test_methods.py @@ -27,7 +27,6 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'rhel', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana'], 'enable') @@ -39,11 +38,10 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana'], 'enable') - expectCmd = 'RUN yum-config-manager --enable grafana' + expectCmd = 'RUN dnf config-manager --enable grafana || true' self.assertEqual(expectCmd, result) def test_enable_repos_centos_missing_repo(self): @@ -51,7 +49,6 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['missing_repo'], @@ -64,13 +61,12 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana', 'ceph'], 'enable') - expectCmd = 'RUN yum-config-manager --enable grafana ' - expectCmd += '--enable centos-ceph-nautilus' + expectCmd = 'RUN dnf config-manager --enable grafana ' + expectCmd += '--enable centos-ceph-nautilus || true' self.assertEqual(expectCmd, result) def test_enable_repos_debian(self): @@ -118,11 +114,10 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana'], 'disable') - expectCmd = 'RUN yum-config-manager --disable grafana' + expectCmd = 'RUN dnf config-manager --disable grafana || true' self.assertEqual(expectCmd, result) def test_disable_repos_centos_multiple(self): @@ -130,13 +125,12 @@ class MethodsTest(base.TestCase): 'base_arch': 'x86_64', 'base_distro': 'centos', 'base_package_type': 'rpm', - 'distro_package_manager': 'yum' } result = methods.handle_repos(template_vars, ['grafana', 'ceph'], 'disable') - expectCmd = 'RUN yum-config-manager --disable grafana ' - expectCmd += '--disable centos-ceph-nautilus' + expectCmd = 'RUN dnf config-manager --disable grafana ' + expectCmd += '--disable centos-ceph-nautilus || true' self.assertEqual(expectCmd, result) # NOTE(hrw): there is no disabling of repos for Debian/Ubuntu -- cgit v1.2.3