From fca732b81e4eb5daa56da16e338bdd305a56d5bd Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 15 Jan 2019 16:33:24 -0700 Subject: Add base_package_type Currently in all the Dockerfile.j2 files, we are doing base distro if conditions for package names when installing via a binary. Rather than duplicating these base_distro in [], let's provide a single value for determining the binary installation method. This change adds a base_package_type which we can use to lookup if 'rpm' or if 'deb' rather than relying on specific distro names. Change-Id: I8a0c6c8fbc32a8cfa6932fddf28a449fceda3d49 --- kolla/tests/test_build.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'kolla/tests') diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index c6a953003..6ed50fbf1 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -401,6 +401,24 @@ class KollaWorkerTest(base.TestCase): kolla = build.KollaWorker(self.conf) self.assertFalse(kolla.distro_python3) + def test_base_package_type(self): + """check base_package_type conf value is taken""" + self.conf.set_override('base_package_type', 'pip') + kolla = build.KollaWorker(self.conf) + self.assertEqual('pip', kolla.base_package_type) + + def test_base_package_type_rhel(self): + """check base_package_type rpm for rhel""" + self.conf.set_override('base', 'rhel') + kolla = build.KollaWorker(self.conf) + self.assertEqual('rpm', kolla.base_package_type) + + def test_base_package_type_debian(self): + """check base_package_type deb for debian""" + self.conf.set_override('base', 'debian') + kolla = build.KollaWorker(self.conf) + self.assertEqual('deb', kolla.base_package_type) + def test_pre_defined_exist_profile(self): # default profile include the fake image: image-base self.conf.set_override('profile', ['default']) -- cgit v1.2.3