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()
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()
def setUp(self): super(OpenDaylightMechanismDriverTestCase, self).setUp() self.useFixture(odl_base.OpenDaylightRestClientFixture()) config.cfg.CONF.set_override('mechanism_drivers', ['logger', 'opendaylight'], 'ml2') self.mech = mech_driver.OpenDaylightMechanismDriver() self.mech.initialize()
def setUp(self): super(TestPseudoAgentDBBindingControllerBug1608659, self).setUp( plugin='ml2') self.useFixture(base.OpenDaylightRestClientFixture()) self.core_plugin = directory.get_plugin() self.mgr = pseudo_agentdb_binding.PseudoAgentDBBindingController( self.core_plugin)
def setUp(self): self.useFixture(base.OpenDaylightRestClientFixture()) super(ODLCallbackTestCase, self).setUp() self._precommit = mock.Mock() self._postcommit = mock.Mock() self.sgh = callback.OdlSecurityGroupsHandler(self._precommit, self._postcommit)
def setUp(self): self.useFixture(base.OpenDaylightRestClientFixture()) self.useFixture(base.OpenDaylightPseudoAgentPrePopulateFixture()) self.useFixture(OpenDaylightAgentDBFixture()) super(TestPseudoAgentDBBindingControllerBug1608659, self).setUp( plugin='ml2') self.worker = pseudo_agentdb_binding.PseudoAgentDBBindingWorker()
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 })
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightFeaturesFixture()) self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture()) super(TestOpenDaylightMechanismDriver, self).setUp() config.cfg.CONF.set_override('mechanism_drivers', ['logger', 'opendaylight'], 'ml2')
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'} mock.patch.object(journal.OpendaylightJournalThread, 'start_odl_sync_thread').start() self.mock_mt_thread = mock.patch.object( maintenance.MaintenanceThread, 'start').start() mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver, '_record_in_journal').start() mock.patch.object(mech_driver_v2.OpenDaylightMechanismDriver, 'sync_from_callback').start() super(OpenDaylightL3TestCase, self).setUp( plugin=core_plugin, service_plugins=service_plugins) self.db_session = neutron_db_api.get_session() self.plugin = manager.NeutronManager.get_plugin() self.plugin._network_is_external = mock.Mock(return_value=True) self.driver = manager.NeutronManager.get_service_plugins()[ service_constants.L3_ROUTER_NAT] self.thread = journal.OpendaylightJournalThread() self.driver.get_floatingip = mock.Mock( return_value={'router_id': ROUTER_ID, 'floating_network_id': NETWORK_ID})
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightFeaturesFixture()) super(OpenDayLightMechanismConfigTests, self).setUp() cfg.CONF.set_override('mechanism_drivers', ['logger', 'opendaylight_v2'], 'ml2') cfg.CONF.set_override('port_binding_controller', 'legacy-port-binding', 'ml2_odl')
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)
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightFeaturesFixture()) self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture()) self.cfg = self.useFixture(config_fixture.Config()) super(TestOpenDaylightMechanismDriver, self).setUp() self.cfg.config(mechanism_drivers=[ 'logger', 'opendaylight'], group='ml2')
def setUp(self): """Setup test.""" self.useFixture(base.OpenDaylightRestClientFixture()) self.useFixture(base.OpenDaylightPseudoAgentPrePopulateFixture()) self.useFixture(OpenDaylightAgentDBFixture()) super(TestPseudoAgentDBBindingWorker, self).setUp() self.worker = pseudo_agentdb_binding.PseudoAgentDBBindingWorker()
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightFeaturesFixture()) self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture()) super(OpenDaylightMechanismDriverTestCase, self).setUp() cfg.CONF.set_override('mechanism_drivers', ['logger', 'opendaylight'], 'ml2') self.mech = mech_driver.OpenDaylightMechanismDriver() self.mech.initialize()
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()
def setUp(self): self.useFixture(base.OpenDaylightRestClientFixture()) super(OpenDaylightConfigBase, self).setUp() cfg.CONF.set_override('mechanism_drivers', ['logger', 'opendaylight_v2'], '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()
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightFeaturesFixture()) self.cfg = self.useFixture(config_fixture.Config()) super(OpenDayLightMechanismConfigTests, self).setUp() self.cfg.config(mechanism_drivers=['logger', 'opendaylight_v2'], group='ml2') self.cfg.config(port_binding_controller='legacy-port-binding', group='ml2_odl')
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightFeaturesFixture()) super(OpenDaylightTestCase, self).setUp() self.port_create_status = 'DOWN' self.mech = mech_driver.OpenDaylightMechanismDriver() mock.patch.object(client.OpenDaylightRestClient, 'sendjson', new=self.check_sendjson).start()
def setUp(self): """Setup test.""" self.useFixture(base.OpenDaylightRestClientFixture()) self.useFixture(base.OpenDaylightFeaturesFixture()) self.useFixture(base.OpenDaylightPseudoAgentPrePopulateFixture()) self.useFixture(OpenDaylightAgentDBFixture()) super(TestPseudoAgentDBBindingController, self).setUp() self.useFixture(fixture.CallbackRegistryFixture()) self.mgr = pseudo_agentdb_binding.PseudoAgentDBBindingController()
def setUp(self): """Setup test.""" super(TestPseudoAgentDBBindingController, self).setUp() self.useFixture(base.OpenDaylightRestClientFixture()) fake_agents_db = mock.MagicMock() fake_agents_db.create_or_update_agent = mock.MagicMock() self.mgr = pseudo_agentdb_binding.PseudoAgentDBBindingController( db_plugin=fake_agents_db)
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.mocked_fc_context = patch( 'networking_sfc.services.flowclassifier.common.context' '.FlowClassifierContext').start().return_value super(TestOpenDaylightSFCFlowClassifierDriverV1, self).setUp() self.driver = sfc_fc.OpenDaylightSFCFlowClassifierDriverV1() self.driver.initialize() self.mocked_fc_context.current = sfc_const.FAKE_FLOW_CLASSIFIER
def setUp(self): self.useFixture(base.OpenDaylightRestClientFixture()) self.useFixture(base.OpenDaylightJournalThreadFixture()) self.useFixture(base.OpenDaylightFeaturesFixture()) self.useFixture(base.OpenDaylightPseudoAgentPrePopulateFixture()) self.mock_periodic_thread = mock.patch.object( periodic_task.PeriodicTask, 'start').start() super(TestPseudoAgentNeutronWorker, self).setUp() cfg.CONF.set_override('mechanism_drivers', ['opendaylight_v2'], 'ml2') cfg.CONF.set_override('port_binding_controller', 'pseudo-agentdb-binding', 'ml2_odl')
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()
def setUp(self): self.useFixture(base.OpenDaylightRestClientFixture()) self.useFixture(base.OpenDaylightJournalThreadFixture()) self.useFixture(base.OpenDaylightFeaturesFixture()) self.useFixture(base.OpenDaylightPseudoAgentPrePopulateFixture()) self.cfg = self.useFixture(config_fixture.Config()) self.mock_periodic_thread = mock.patch.object( periodic_task.PeriodicTask, 'start').start() super(TestPseudoAgentNeutronWorker, self).setUp() self.cfg.config(mechanism_drivers=['opendaylight_v2'], group='ml2') self.cfg.config( port_binding_controller='pseudo-agentdb-binding', group='ml2_odl')
def setUp(self): """Setup test.""" self.useFixture(base.OpenDaylightRestClientFixture()) mock.patch.object(wsc.OpenDaylightWebsocketClient, 'start_odl_websocket_thread').start() super(TestWebsocketClient, self).setUp() self.mgr = wsc.OpenDaylightWebsocketClient.odl_create_websocket( "http://localhost:8080/", "restconf/operational/neutron:neutron/hostconfigs", wsc.ODL_OPERATIONAL_DATASTORE, wsc.ODL_NOTIFICATION_SCOPE_SUBTREE, TestWebsocketClient.mock_callback_handler)
def setUp(self): self.useFixture(base.OpenDaylightRestClientFixture()) self.useFixture(OpenDaylightAgentDBFixture()) super(TestPseudoAgentDBBindingPrePopulate, self).setUp() self.useFixture(fixture.CallbackRegistryFixture()) self.ml2_plugin = mock.Mock() self.ml2_plugin.get_agents = mock.Mock(return_value=[]) self.worker = mock.Mock() self.worker.known_agent = mock.Mock(return_value=False) self.worker.add_known_agent = mock.Mock() self.worker.update_agetns_db_row = mock.Mock() self.prepopulate = (pseudo_agentdb_binding. PseudoAgentDBBindingPrePopulate(self.worker))
def setUp(self): self.useFixture(odl_base.OpenDaylightFeaturesFixture()) self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture()) super(Testodll3, self).setUp() # support ext-gw-mode for key in l3.RESOURCE_ATTRIBUTE_MAP.keys(): l3.RESOURCE_ATTRIBUTE_MAP[key].update( l3_ext_gw_mode.EXTENDED_ATTRIBUTES_2_0.get(key, {})) self._setUpExtension( 'networking_odl.l3.l3_odl.OpenDaylightL3RouterPlugin', constants.L3, l3.RESOURCE_ATTRIBUTE_MAP, l3.L3, '', allow_pagination=True, allow_sorting=True, supported_extension_aliases=['router', 'ext-gw-mode'], use_quota=True)
def setUp(self): self.useFixture(odl_base.OpenDaylightFeaturesFixture()) self.useFixture(odl_base.OpenDaylightRestClientFixture()) self.useFixture(odl_base.OpenDaylightPseudoAgentPrePopulateFixture()) super(Testodll3, self).setUp() self._setUpExtension( 'networking_odl.l3.l3_odl.OpenDaylightL3RouterPlugin', constants.L3, l3_apidef.RESOURCE_ATTRIBUTE_MAP, l3.L3, '', allow_pagination=True, allow_sorting=True, supported_extension_aliases=[l3_apidef.ALIAS, l3egm_apidef.ALIAS], use_quota=True) # support ext-gw-mode after fixture used via _setUpExtension() l3.L3().update_attributes_map(l3egm_apidef.RESOURCE_ATTRIBUTE_MAP)
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) super(TestOpenDaylightSFCDriverV1, self).setUp() self.mocked_pp_context = patch( 'networking_sfc.services.sfc.common.context.PortPairContext' ).start().return_value self.mocked_ppg_context = patch( 'networking_sfc.services.sfc.common.context.PortPairGroupContext' ).start().return_value self.mocked_pc_context = patch( 'networking_sfc.services.sfc.common.context.PortChainContext' ).start().return_value self.driver = sfc_driver_v1.OpenDaylightSFCDriverV1() self.driver.initialize() self.mocked_pp_context.current = sfc_const.FAKE_PORT_PAIR self.mocked_ppg_context.current = sfc_const.FAKE_PORT_PAIR_GROUP self.mocked_pc_context.current = sfc_const.FAKE_PORT_CHAIN
def setUp(self): self.useFixture(odl_base.OpenDaylightRestClientFixture()) super(OpenDaylightTestCase, self).setUp() self.port_create_status = 'DOWN' self.mech = mech_driver.OpenDaylightMechanismDriver() mock.patch.object(client.OpenDaylightRestClient, 'sendjson', new=self.check_sendjson).start() # Prevent test from accidentally connecting to any web service mock.patch.object( network_topology, 'NetworkTopologyClient', return_value=mock.Mock( specs=network_topology.NetworkTopologyClient, get=mock.Mock(side_effect=requests.HTTPError))).start() # Prevent hosts resolution from changing the behaviour of tests mock.patch.object(network_topology.utils, 'get_addresses_by_name', side_effect=socket.gaierror).start()