コード例 #1
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)
コード例 #2
0
    def test_pre_defined_exist_profile_not_include(self):
        # infra profile do not include the fake image: image-base
        self.conf.set_override('profile', ['infra'])
        kolla = build.KollaWorker(self.conf)
        kolla.images = self.images
        kolla.filter_images()

        self.assertEqual(0, len(self._get_matched_images(kolla.images)))
コード例 #3
0
    def test_pre_defined_exist_profile(self):
        # default profile include the fake image: image-base
        self.conf.set_override('profile', ['default'])
        kolla = build.KollaWorker(self.conf)
        kolla.images = self.images
        kolla.filter_images()

        self.assertEqual(1, len(self._get_matched_images(kolla.images)))
コード例 #4
0
    def test_supported_base_type(self):
        rh_base = ['fedora', 'centos', 'oraclelinux', 'rhel']
        rh_type = ['source', 'binary', 'rdo', 'rhos']
        deb_base = ['ubuntu', 'debian']
        deb_type = ['source', 'binary']

        for base_distro, install_type in itertools.chain(
                itertools.product(rh_base, rh_type),
                itertools.product(deb_base, deb_type)):
            self.conf.set_override('base', base_distro)
            self.conf.set_override('install_type', install_type)
            # should no exception raised
            build.KollaWorker(self.conf)
コード例 #5
0
    def test_build_image_list_adds_plugins(self):

        self.conf.set_override('install_type', 'source')

        kolla = build.KollaWorker(self.conf)
        kolla.setup_working_dir()
        kolla.find_dockerfiles()
        kolla.create_dockerfiles()
        kolla.build_image_list()
        expected_plugin = {
            'name': 'neutron-server-plugin-networking-arista',
            'reference': 'master',
            'source': 'https://github.com/openstack/networking-arista',
            'type': 'git'
        }
        for image in kolla.images:
            if image['name'] == 'neutron-server':
                self.assertEqual(image['plugins'][0], expected_plugin)
                break
        else:
            self.fail('Can not find the expected neutron arista plugin')
コード例 #6
0
    def test_without_profile(self):
        kolla = build.KollaWorker(self.conf)
        kolla.images = self.images
        kolla.filter_images()

        self.assertEqual(1, len(self._get_matched_images(kolla.images)))