Ejemplo n.º 1
0
    def __init__(self):
        super(OpenDaylightL3RouterPlugin, self).__init__()

        # TODO(rcurran): Continue investigation into how many journal threads
        # to run per neutron controller deployment.
        self.journal = journal.OpenDaylightJournalThread()
        full_sync.register(plugin_constants.L3, L3_RESOURCES)
Ejemplo n.º 2
0
 def setUp(self):
     cfg.CONF.set_override("core_plugin",
                           'neutron.plugins.ml2.plugin.Ml2Plugin')
     cfg.CONF.set_override('mechanism_drivers',
                           ['logger', 'opendaylight_v2'], 'ml2')
     self.useFixture(odl_base.OpenDaylightRestClientFixture())
     cfg.CONF.set_override("service_plugins", ['odl-router_v2'])
     core_plugin = cfg.CONF.core_plugin
     service_plugins = {'l3_plugin_name': 'odl-router_v2'}
     self.useFixture(odl_base.OpenDaylightJournalThreadFixture())
     mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
                       '_record_in_journal').start()
     mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
                       'sync_from_callback_precommit').start()
     mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
                       'sync_from_callback_postcommit').start()
     self.useFixture(odl_base.OpenDaylightPeriodicTaskFixture())
     self.useFixture(odl_base.OpenDaylightFeaturesFixture())
     self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture())
     super(OpenDaylightL3TestCase,
           self).setUp(plugin=core_plugin, service_plugins=service_plugins)
     self.plugin = directory.get_plugin()
     self.plugin._network_is_external = mock.Mock(return_value=True)
     self.driver = directory.get_plugin(constants.L3)
     self.thread = journal.OpenDaylightJournalThread()
     self.driver.get_floatingip = mock.Mock(
         return_value={
             'router_id': ROUTER_ID,
             'floating_network_id': NETWORK_ID
         })
Ejemplo n.º 3
0
 def __init__(self, driver, obj_type):
     LOG.debug("Initializing OpenDaylight LBaaS driver")
     super(OpenDaylightManager, self).__init__(driver)
     self.journal = journal.OpenDaylightJournalThread()
     self.obj_type = obj_type
     full_sync.register(nlib_const.LOADBALANCERV2, LBAAS_RESOURCES)
     self.driver = driver
Ejemplo n.º 4
0
 def setUp(self):
     self.cfg = self.useFixture(config_fixture.Config())
     self.cfg.config(core_plugin='neutron.plugins.ml2.plugin.Ml2Plugin')
     self.cfg.config(mechanism_drivers=['logger', 'opendaylight_v2'],
                     group='ml2')
     self.useFixture(odl_base.OpenDaylightRestClientFixture())
     self.cfg.config(service_plugins=['odl-router_v2'])
     core_plugin = cfg.CONF.core_plugin
     service_plugins = {'l3_plugin_name': 'odl-router_v2'}
     self.useFixture(odl_base.OpenDaylightJournalThreadFixture())
     mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
                       '_record_in_journal').start()
     mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
                       'sync_from_callback_precommit').start()
     mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver,
                       'sync_from_callback_postcommit').start()
     self.useFixture(odl_base.OpenDaylightPeriodicTaskFixture())
     self.useFixture(odl_base.OpenDaylightFeaturesFixture())
     self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture())
     super(OpenDaylightL3TestCase,
           self).setUp(plugin=core_plugin, service_plugins=service_plugins)
     self.plugin = directory.get_plugin()
     self.plugin._network_is_external = mock.Mock(return_value=True)
     self.driver = directory.get_plugin(constants.L3)
     self.thread = journal.OpenDaylightJournalThread()
Ejemplo n.º 5
0
 def setUp(self):
     self.journal_thread_fixture = self.useFixture(
         base.OpenDaylightJournalThreadFixture())
     self.useFixture(base.OpenDaylightRestClientFixture())
     self.useFixture(base.OpenDaylightFullSyncFixture())
     super(OpenDaylightConfigBase, self).setUp()
     self.thread = journal.OpenDaylightJournalThread()
Ejemplo n.º 6
0
 def __init__(self, l3_plugin):
     super(ODLL3ServiceProvider, self).__init__(l3_plugin)
     self.journal = journal.OpenDaylightJournalThread()
     # TODO(yamahata): add method for fullsync to retrieve
     # all the router with odl service provider.
     # other router with other service provider should be filtered.
     full_sync.register(plugin_constants.L3, L3_RESOURCES)
     self.odl_provider = __name__ + "." + self.__class__.__name__
Ejemplo n.º 7
0
 def __init__(self, service_plugin):
     LOG.info("Initializing OpenDaylight BGPVPN v2 driver")
     super(OpenDaylightBgpvpnDriver, self).__init__(service_plugin)
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(bgpvpn_const.ALIAS, BGPVPN_RESOURCES,
                        self.get_resources)
     if odl_features.has(BGPVPN_VNI):
         self.more_supported_extension_aliases = [bgpvpn_vni_def.ALIAS]
Ejemplo n.º 8
0
 def __init__(self):
     super(JournalPeriodicProcessor, self).__init__()
     self._journal = journal.OpenDaylightJournalThread(start_thread=False)
     self._interval = cfg.CONF.ml2_odl.sync_timeout
     self._timer = None
     self._maintenance_task = None
     self._running = None
     self.pidfile = None
Ejemplo n.º 9
0
 def setUp(self):
     self.journal_thread_fixture = self.useFixture(
         base.OpenDaylightJournalThreadFixture())
     self.useFixture(base.OpenDaylightRestClientFixture())
     self.useFixture(base.OpenDaylightFullSyncFixture())
     super(OpenDaylightConfigBase, self).setUp()
     self.thread = journal.OpenDaylightJournalThread()
     self.addCleanup(base_driver.ALL_RESOURCES.clear)
Ejemplo n.º 10
0
 def setUp(self):
     self.useFixture(base.OpenDaylightJournalThreadFixture())
     self.useFixture(base.OpenDaylightRestClientFixture())
     super(OpenDaylightConfigBase, self).setUp()
     cfg.CONF.set_override('mechanism_drivers',
                           ['logger', 'opendaylight_v2'], 'ml2')
     cfg.CONF.set_override('extension_drivers', ['port_security', 'qos'],
                           'ml2')
     self.thread = journal.OpenDaylightJournalThread()
Ejemplo n.º 11
0
    def test_terminate_journal_thread_correctly(self, mock_journal):
        self.journal_thread_fixture.journal_thread_mock.stop()
        self.addCleanup(self.journal_thread_fixture.journal_thread_mock.start)

        journal_thread = journal.OpenDaylightJournalThread(start_thread=True)

        journal_thread.stop(5)
        self.assertTrue(not journal_thread._odl_sync_thread.is_alive())
        mock_journal.assert_called_once()
Ejemplo n.º 12
0
    def test_allow_multiple_starts_gracefully(self, mock_journal):
        self.journal_thread_fixture.journal_thread_mock.stop()
        self.addCleanup(self.journal_thread_fixture.journal_thread_mock.start)
        journal_thread = journal.OpenDaylightJournalThread(start_thread=False)
        self.addCleanup(journal_thread.stop)
        journal_thread.start()

        try:
            journal_thread.start()
        except RuntimeError:
            self.fail('OpenDaylightJournalThread started twice')
Ejemplo n.º 13
0
 def setUp(self):
     self.journal_thread_fixture = self.useFixture(
         base.OpenDaylightJournalThreadFixture())
     self.useFixture(base.OpenDaylightRestClientFixture())
     self.useFixture(base.OpenDaylightFullSyncFixture())
     super(OpenDaylightConfigBase, self).setUp()
     self.cfg.config(mechanism_drivers=['logger', 'opendaylight_v2'],
                     group='ml2')
     self.cfg.config(extension_drivers=['port_security', 'qos'],
                     group='ml2')
     self.thread = journal.OpenDaylightJournalThread()
Ejemplo n.º 14
0
 def __init__(self,
              supported_rules,
              name='OpenDaylightQosDriver',
              vif_types=VIF_TYPES,
              vnic_types=VNIC_TYPES,
              requires_rpc_notifications=False):
     super(OpenDaylightQosDriver,
           self).__init__(name, vif_types, vnic_types, supported_rules,
                          requires_rpc_notifications)
     LOG.debug("Initializing OpenDaylight Qos driver")
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(nlib_const.QOS, QOS_RESOURCES)
Ejemplo n.º 15
0
 def setUp(self):
     self.useFixture(base.OpenDaylightRestClientFixture())
     super(OpenDaylightConfigBase, self).setUp()
     cfg.CONF.set_override('mechanism_drivers',
                           ['logger', 'opendaylight_v2'], 'ml2')
     cfg.CONF.set_override('extension_drivers', ['port_security', 'qos'],
                           'ml2')
     self.mock_sync_thread = mock.patch.object(
         journal.OpenDaylightJournalThread,
         'start_odl_sync_thread').start()
     self.mock_mt_thread = mock.patch.object(maintenance.MaintenanceThread,
                                             'start').start()
     self.thread = journal.OpenDaylightJournalThread()
Ejemplo n.º 16
0
 def initialize(self):
     LOG.debug("Initializing OpenDaylight ML2 driver")
     cfg.CONF.register_opts(odl_conf.odl_opts, "ml2_odl")
     self.sg_handler = callback.OdlSecurityGroupsHandler(
         self.sync_from_callback_precommit,
         self.sync_from_callback_postcommit)
     self.journal = journal.OpenDaylightJournalThread()
     self.port_binding_controller = port_binding.PortBindingManager.create()
     self.trunk_driver = trunk_driver.OpenDaylightTrunkDriverV2.create()
     if odl_const.ODL_QOS in cfg.CONF.ml2.extension_drivers:
         qos_driver.OpenDaylightQosDriver.create()
     self._start_maintenance_thread()
     odl_features.init()
Ejemplo n.º 17
0
    def initialize(self):
        LOG.debug("Initializing OpenDaylight ML2 driver")
        cfg.CONF.register_opts(odl_conf.odl_opts, "ml2_odl")
        self.sg_handler = callback.OdlSecurityGroupsHandler(
            self.sync_from_callback_precommit,
            self.sync_from_callback_postcommit)
        self.journal = journal.OpenDaylightJournalThread()
        self.port_binding_controller = port_binding.PortBindingManager.create()
        self.trunk_driver = trunk_driver.OpenDaylightTrunkDriverV2.create()
        if odl_const.ODL_QOS in cfg.CONF.ml2.extension_drivers:
            qos_driver.OpenDaylightQosDriver.create()
        if cfg.CONF.ml2_odl.enable_dhcp_service:
            self.dhcp_driver = dhcp_driver.OdlDhcpDriver()

        full_sync.register(nlib_const.CORE, L2_RESOURCES)
        odl_features.init()
Ejemplo n.º 18
0
 def initialize(self):
     LOG.debug("Initializing OpenDaylight Networking "
               "SFC Flow Classifier driver Version 2")
     self.journal = journal.OpenDaylightJournalThread()
Ejemplo n.º 19
0
 def initialize(self):
     LOG.debug("Initializing OpenDaylight Networking SFC driver(Version 2)")
     self.journal = journal.OpenDaylightJournalThread()
 def __init__(self, service_plugin, validator=None):
     super(OpenDaylightL2gwDriver, self).__init__(service_plugin, validator)
     self.service_plugin = service_plugin
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(constants.L2GW, L2GW_RESOURCES)
     LOG.info("ODL: Started OpenDaylight L2Gateway V2 driver")
Ejemplo n.º 21
0
 def __init__(self, driver, obj_type):
     LOG.debug("Initializing OpenDaylight LBaaS driver")
     super(OpenDaylightManager, self).__init__(driver)
     self.journal = journal.OpenDaylightJournalThread()
     self.obj_type = obj_type
Ejemplo n.º 22
0
 def __init__(self):
     cfg.CONF.register_opts(odl_conf.odl_opts, "ml2_odl")
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(t_consts.TRUNK, TRUNK_RESOURCES)
     LOG.info('initialized trunk driver for OpendayLight')
Ejemplo n.º 23
0
 def __init__(self):
     super(OpenDaylightL3RouterPlugin, self).__init__()
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(plugin_constants.L3, L3_RESOURCES)
Ejemplo n.º 24
0
 def initialize(self):
     LOG.debug("Initializing OpenDaylight Networking SFC driver(Version 2)")
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(sfc_const.SFC_EXT, SFC_RESOURCES)
Ejemplo n.º 25
0
 def __init__(self, service_plugin, validator=None):
     super(OpenDaylightL2gwDriver, self).__init__(service_plugin, validator)
     self.service_plugin = service_plugin
     self.journal = journal.OpenDaylightJournalThread()
     LOG.info("ODL: Started OpenDaylight L2Gateway V2 driver")
Ejemplo n.º 26
0
 def setUp(self):
     super(OpenDaylightJournalThreadTest, self).setUp()
     self.journal = journal.OpenDaylightJournalThread()
     self.addCleanup(self.cleanup)
Ejemplo n.º 27
0
 def __init__(self):
     cfg.CONF.register_opts(odl_conf.odl_opts, "ml2_odl")
     self.journal = journal.OpenDaylightJournalThread()
     LOG.info('initialized trunk driver for OpendayLight')
Ejemplo n.º 28
0
 def __init__(self, service_plugin):
     LOG.info("Initializing OpenDaylight BGPVPN v2 driver")
     super(OpenDaylightBgpvpnDriver, self).__init__(service_plugin)
     self.journal = journal.OpenDaylightJournalThread()
Ejemplo n.º 29
0
 def __init__(self, service_plugin):
     LOG.info("Initializing OpenDaylight BGPVPN v2 driver")
     super(OpenDaylightBgpvpnDriver, self).__init__(service_plugin)
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(bgpvpn_const.LABEL, BGPVPN_RESOURCES)
 def initialize(self):
     LOG.debug("Initializing OpenDaylight Networking "
               "SFC Flow Classifier driver Version 2")
     self.journal = journal.OpenDaylightJournalThread()
     full_sync.register(fc_const.FLOW_CLASSIFIER_EXT, SFC_FC_RESOURCES)