Beispiel #1
0
 def test_set_time(self):
     self.conf.set_override('install_type', 'source')
     kolla = build.KollaWorker(self.conf)
     kolla.setup_working_dir()
     kolla.set_time()
Beispiel #2
0
 def test_work_dir(self, copytree_mock):
     self.conf.set_override('work_dir', 'tmp/foo')
     kolla = build.KollaWorker(self.conf)
     kolla.setup_working_dir()
     self.assertEqual('tmp/foo/docker', kolla.working_dir)
Beispiel #3
0
    def test_without_profile(self):
        kolla = build.KollaWorker(self.conf)
        kolla.images = self.images
        kolla.filter_images()

        self.assertEqual(2, len(self._get_matched_images(kolla.images)))
Beispiel #4
0
 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)
Beispiel #5
0
 def test_pre_defined_not_exist_profile(self):
     # NOTE(jeffrey4l): not exist profile will raise ValueError
     self.conf.set_override('profile', ['not_exist'])
     kolla = build.KollaWorker(self.conf)
     kolla.images = self.images
     self.assertRaises(ValueError, kolla.filter_images)
Beispiel #6
0
 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)
Beispiel #7
0
 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)
Beispiel #8
0
 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)
Beispiel #9
0
 def test_build_distro_package_manager_ubuntu(self):
     """check distro_package_manager apt for ubuntu"""
     self.conf.set_override('base', 'ubuntu')
     kolla = build.KollaWorker(self.conf)
     self.assertEqual('apt', kolla.distro_package_manager)
Beispiel #10
0
 def test_build_distro_package_manager(self):
     """check distro_package_manager conf value is taken"""
     self.conf.set_override('distro_package_manager', 'foo')
     kolla = build.KollaWorker(self.conf)
     self.assertEqual('foo', kolla.distro_package_manager)
Beispiel #11
0
 def test_build_distro_package_manager_rhel8_minor(self):
     """check distro_package_manager dnf for rhel8"""
     self.conf.set_override('base', 'rhel')
     self.conf.set_override('base_tag', '8.1.2')
     kolla = build.KollaWorker(self.conf)
     self.assertEqual('dnf', kolla.distro_package_manager)
Beispiel #12
0
 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)
Beispiel #13
0
 def test_build_distro_python_version_centos7(self):
     """check distro_python_version for CentOS 7.6.1810"""
     self.conf.set_override('base', 'centos')
     self.conf.set_override('base_tag', '7.6.1810')
     kolla = build.KollaWorker(self.conf)
     self.assertEqual('2.7', kolla.distro_python_version)
Beispiel #14
0
 def test_build_distro_python_version_ubuntu(self):
     """check distro_python_version for Ubuntu"""
     self.conf.set_override('base', 'ubuntu')
     kolla = build.KollaWorker(self.conf)
     self.assertEqual('3.6', kolla.distro_python_version)
Beispiel #15
0
 def test_build_distro_python_version_debian(self):
     """check distro_python_version for Debian"""
     self.conf.set_override('base', 'debian')
     kolla = build.KollaWorker(self.conf)
     self.assertEqual('3.7', kolla.distro_python_version)
Beispiel #16
0
 def test_build_rpm_setup(self):
     """checking the length of list of docker commands"""
     self.conf.set_override('rpm_setup_config', ["a.rpm", "b.repo"])
     kolla = build.KollaWorker(self.conf)
     self.assertEqual(2, len(kolla.rpm_setup))