Beispiel #1
0
 def setUp(self):
     super(BaseOvnIdlTest, self).setUp()
     ovn_conf.register_opts()
     self.api = impl.OvsdbSbOvnIdl(self.connection['OVN_Southbound'])
     self.nbapi = impl.OvsdbNbOvnIdl(self.connection['OVN_Northbound'])
     self.handler = ovsdb_event.RowEventHandler()
     self.api.idl.notify = self.handler.notify
Beispiel #2
0
 def setUp(self):
     ovn_conf.register_opts()
     cfg.CONF.set_override('extension_drivers',
                           self._extension_drivers,
                           group='ml2')
     cfg.CONF.set_override('enable_distributed_floating_ip',
                           'False',
                           group='ovn')
     extensions.register_custom_supported_check(qos_api.ALIAS,
                                                lambda: True,
                                                plugin_agnostic=True)
     super(TestOVNClientQosExtension, self).setUp()
     self.setup_coreplugin(self.CORE_PLUGIN_CLASS, load_plugins=True)
     self._mock_qos_loaded = mock.patch.object(
         core_qos.QosCoreResourceExtension, 'plugin_loaded')
     self.mock_qos_loaded = self._mock_qos_loaded.start()
     self.txn = _Context()
     mock_driver = mock.Mock()
     mock_driver._nb_idl.transaction.return_value = self.txn
     self.qos_driver = qos_extension.OVNClientQosExtension(
         driver=mock_driver)
     self._mock_rules = mock.patch.object(self.qos_driver,
                                          '_update_port_qos_rules')
     self.mock_rules = self._mock_rules.start()
     self.addCleanup(self._mock_rules.stop)
     self.ctx = context.get_admin_context()
     self.project_id = uuidutils.generate_uuid()
     self._initialize_objs()
Beispiel #3
0
 def setUp(self):
     super(ConfFixture, self).setUp()
     ovn_meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, self.conf)
     ovn_meta_conf.register_meta_conf_opts(
         meta_conf.UNIX_DOMAIN_METADATA_PROXY_OPTS, self.conf)
     ovn_meta_conf.register_meta_conf_opts(
         meta_conf.METADATA_PROXY_HANDLER_OPTS, self.conf)
     ovn_meta_conf.register_meta_conf_opts(ovn_meta_conf.OVS_OPTS,
                                           self.conf,
                                           group='ovs')
     ovn_conf.register_opts()
Beispiel #4
0
    def setUp(self, maintenance_worker=False, service_plugins=None):
        ml2_config.cfg.CONF.set_override('extension_drivers',
                                         self._extension_drivers,
                                         group='ml2')
        ml2_config.cfg.CONF.set_override('tenant_network_types', ['geneve'],
                                         group='ml2')
        ml2_config.cfg.CONF.set_override('vni_ranges', ['1:65536'],
                                         group='ml2_type_geneve')
        # ensure viable minimum is set for OVN's Geneve
        ml2_config.cfg.CONF.set_override('max_header_size',
                                         38,
                                         group='ml2_type_geneve')
        ovn_conf.register_opts()
        ovn_conf.cfg.CONF.set_override('dns_servers', ['10.10.10.10'],
                                       group='ovn')
        ovn_conf.cfg.CONF.set_override('api_workers', 1)

        self.addCleanup(exts.PluginAwareExtensionManager.clear_instance)
        self.ovsdb_server_mgr = None
        self._service_plugins = service_plugins
        super(TestOVNFunctionalBase, self).setUp()
        self.test_log_dir = os.path.join(DEFAULT_LOG_DIR, self.id())
        base.setup_test_logging(cfg.CONF, self.test_log_dir, "testrun.txt")

        mm = directory.get_plugin().mechanism_manager
        self.mech_driver = mm.mech_drivers['ovn'].obj
        self.l3_plugin = directory.get_plugin(constants.L3)
        self.segments_plugin = directory.get_plugin('segments')
        # OVN does not use RPC: disable it for port-forwarding tests
        self.pf_plugin = manager.NeutronManager.load_class_for_provider(
            'neutron.service_plugins', 'port_forwarding')()
        self.pf_plugin._rpc_notifications_required = False
        self.log_plugin = directory.get_plugin(constants.LOG_API)
        if not self.log_plugin:
            self.log_plugin = manager.NeutronManager.load_class_for_provider(
                'neutron.service_plugins', 'log')()
            directory.add_plugin(constants.LOG_API, self.log_plugin)
            self.log_plugin.driver_manager.register_driver(
                self.mech_driver.log_driver)
        self.mech_driver.log_driver.plugin_driver = self.mech_driver
        self.mech_driver.log_driver._log_plugin_property = None
        self.ovn_northd_mgr = None
        self.maintenance_worker = maintenance_worker
        mock.patch('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
                   'maintenance.MaintenanceThread').start()
        mock.patch('neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.'
                   'maintenance.HashRingHealthCheckPeriodics').start()
        self._start_idls()
        self._start_ovn_northd()
        self.addCleanup(self._reset_agent_cache_singleton)
        self.addCleanup(self._reset_ovn_client_placement_extension)
Beispiel #5
0
def main():
    config.register_common_config_options()
    ovn_conf.register_opts()
    ovn_meta.register_meta_conf_opts(meta.SHARED_OPTS)
    ovn_meta.register_meta_conf_opts(meta.UNIX_DOMAIN_METADATA_PROXY_OPTS)
    ovn_meta.register_meta_conf_opts(meta.METADATA_PROXY_HANDLER_OPTS)
    ovn_meta.register_meta_conf_opts(ovn_meta.OVS_OPTS, group='ovs')
    config.init(sys.argv[1:])
    config.setup_logging()
    ovn_meta.setup_privsep()
    utils.log_opt_values(LOG)

    agt = agent.MetadataAgent(cfg.CONF)
    agt.start()
Beispiel #6
0
    def setUp(self):
        ovn_conf.register_opts()
        super(TestOvnIdlDistributedLock, self).setUp()
        self.node_uuid = uuidutils.generate_uuid()
        self.fake_driver = mock.Mock()
        self.fake_driver.node_uuid = self.node_uuid
        self.fake_event = 'fake-event'
        self.fake_row = fakes.FakeOvsdbRow.create_one_ovsdb_row(
            attrs={'_table': mock.Mock(name='FakeTable')})
        helper = ovs_idl.SchemaHelper(schema_json=OVN_NB_SCHEMA)
        helper.register_all()

        with mock.patch.object(ovsdb_monitor, 'OvnDbNotifyHandler'):
            self.idl = ovsdb_monitor.OvnIdlDistributedLock(
                self.fake_driver, 'punix:/tmp/fake', helper)

        self.mock_get_node = mock.patch.object(
            hash_ring_manager.HashRingManager,
            'get_node',
            return_value=self.node_uuid).start()
        self.mock_update_tables = mock.patch.object(self.idl,
                                                    'update_tables').start()
Beispiel #7
0
 def setUp(self):
     ovn_conf.register_opts()
     super().setUp()
Beispiel #8
0
 def setUp(self):
     ovn_conf.register_opts()
     super(TestOvnConnection, self).setUp()
Beispiel #9
0
    def setUp(self):
        super(TestMetadataDriverProcess, self).setUp()
        mock.patch('eventlet.spawn').start()

        ovn_meta_conf.register_meta_conf_opts(meta_conf.SHARED_OPTS, cfg.CONF)
        ovn_conf.register_opts()
Beispiel #10
0
 def setUp(self):
     ovn_conf.register_opts()
     super(TestGetDhcpDnsServers, self).setUp()
Beispiel #11
0
 def setUp(self):
     ovn_conf.register_opts()
     super(TestDHCPUtils, self).setUp()
Beispiel #12
0
 def setUp(self):
     ovn_conf.register_opts()
     super(TestOVNClientBase, self).setUp()
     self.nb_idl = mock.MagicMock()
     self.sb_idl = mock.MagicMock()
     self.ovn_client = ovn_client.OVNClient(self.nb_idl, self.sb_idl)