Exemple #1
0
    def setUp(self):
        super(TestAmphoraInfo, self).setUp()
        self.osutils_mock = mock.MagicMock()
        self.amp_info = amphora_info.AmphoraInfo(self.osutils_mock)
        self.udp_driver = mock.MagicMock()

        # setup a fake haproxy config file
        templater = jinja_cfg.JinjaTemplater(base_amp_path=self.BASE_AMP_PATH,
                                             base_crt_dir=self.BASE_CRT_PATH)
        tls_tupel = {
            'cont_id_1':
            sample_configs_combined.sample_tls_container_tuple(
                id='tls_container_id',
                certificate='imaCert1',
                private_key='imaPrivateKey1',
                primary_cn='FakeCN')
        }
        self.rendered_haproxy_cfg = templater.render_loadbalancer_obj(
            sample_configs_combined.sample_amphora_tuple(), [
                sample_configs_combined.sample_listener_tuple(
                    proto='TERMINATED_HTTPS', tls=True, sni=True)
            ], tls_tupel)
        path = util.config_path(self.LB_ID_1)
        self.useFixture(test_utils.OpenFixture(path,
                                               self.rendered_haproxy_cfg))
Exemple #2
0
    def __init__(self):
        super(HaproxyAmphoraLoadBalancerDriver, self).__init__()
        self.clients = {
            'base': AmphoraAPIClientBase(),
            '0.5': AmphoraAPIClient0_5(),
            '1.0': AmphoraAPIClient1_0(),
        }
        self.cert_manager = stevedore_driver.DriverManager(
            namespace='octavia.cert_manager',
            name=CONF.certificates.cert_manager,
            invoke_on_load=True,
        ).driver

        self.jinja_combo = jinja_combo.JinjaTemplater(
            base_amp_path=CONF.haproxy_amphora.base_path,
            base_crt_dir=CONF.haproxy_amphora.base_cert_dir,
            haproxy_template=CONF.haproxy_amphora.haproxy_template,
            connection_logging=CONF.haproxy_amphora.connection_logging)
        self.jinja_split = jinja_split.JinjaTemplater(
            base_amp_path=CONF.haproxy_amphora.base_path,
            base_crt_dir=CONF.haproxy_amphora.base_cert_dir,
            haproxy_template=CONF.haproxy_amphora.haproxy_template,
            connection_logging=CONF.haproxy_amphora.connection_logging)
        self.udp_jinja = jinja_udp_cfg.LvsJinjaTemplater()
Exemple #3
0
 def setUp(self):
     super(TestUtil, self).setUp()
     self.CONF = self.useFixture(oslo_fixture.Config(cfg.CONF))
     self.listener_id = uuidutils.generate_uuid()
     self.jinja_cfg = jinja_cfg.JinjaTemplater(base_amp_path=BASE_AMP_PATH,
                                               base_crt_dir=BASE_CRT_PATH)