def setUp(self): plugin = 'neutron.tests.unit.extensions.test_l3.TestNoL3NatPlugin' l3_plugin = ('networking_ovn.l3.l3_ovn.OVNL3RouterPlugin') service_plugins = {'l3_plugin_name': l3_plugin} # For these tests we need to enable overlapping ips cfg.CONF.set_default('allow_overlapping_ips', True) cfg.CONF.set_default('max_routes', 3) ext_mgr = test_extraroute.ExtraRouteTestExtensionManager() impl_idl_ovn.OvsdbOvnIdl = mock.Mock() super(test_l3.L3BaseForIntTests, self).setUp(plugin=plugin, ext_mgr=ext_mgr, service_plugins=service_plugins) patcher = mock.patch('networking_ovn.l3.l3_ovn.OVNL3RouterPlugin._ovn', new_callable=mock.PropertyMock, return_value=fakes.FakeOvsdbOvnIdl()) patcher.start() self.setup_notification_driver()
def setUp(self): super(TestACLs, self).setUp() self.driver = mock.Mock() self.driver._ovn = fakes.FakeOvsdbOvnIdl() self.fake_port = { 'id': 'fake_port_id1', 'network_id': 'network_id1', 'fixed_ips': [{ 'subnet_id': 'subnet_id1', 'ip_address': '1.1.1.1' }] } self.fake_subnet = { 'id': 'subnet_id1', 'ip_version': 4, 'cidr': '1.1.1.0/24' } patcher = mock.patch( 'neutron.agent.ovsdb.native.idlutils.row_by_value', lambda *args, **kwargs: mock.MagicMock()) patcher.start()
def setUp(self): super(OVNL3RouterPlugin, self).setUp() self.fake_router_port = { 'device_id': '', 'mac_address': 'aa:aa:aa:aa:aa:aa', 'fixed_ips': [{ 'ip_address': '10.0.0.100', 'subnet_id': 'subnet-id' }], 'id': 'router-port-id' } self.fake_subnet = {'id': 'subnet-id', 'cidr': '10.0.0.1/24'} self.fake_router = { 'id': 'router-id', 'name': 'router', 'admin_state_up': False, 'routes': [{ 'destination': '1.1.1.0/24', 'nexthop': '2.2.2.3' }] } mgr = manager.NeutronManager.get_instance() self.l3_plugin = mgr.get_service_plugins().get( service_constants.L3_ROUTER_NAT) mock.patch('networking_ovn.l3.l3_ovn.OVNL3RouterPlugin._ovn', new_callable=mock.PropertyMock, return_value=fakes.FakeOvsdbOvnIdl()).start() mock.patch( 'neutron.db.l3_db.L3_NAT_db_mixin.notify_router_interface_action' ).start() mock.patch('neutron.db.db_base_plugin_v2.NeutronDbPluginV2.get_port', return_value=self.fake_router_port).start() mock.patch('neutron.db.db_base_plugin_v2.NeutronDbPluginV2.get_subnet', return_value=self.fake_subnet).start() mock.patch('neutron.db.l3_db.L3_NAT_dbonly_mixin.get_router', return_value=self.fake_router).start() mock.patch( 'neutron.db.extraroute_db.ExtraRoute_dbonly_mixin.update_router', return_value=self.fake_router).start()
def setUp(self): super(OVNMechanismDriverTestCase, self).setUp() self.port_create_status = 'DOWN' self.mech = mech_driver.OVNMechanismDriver self.mech._ovn = fakes.FakeOvsdbOvnIdl() self.mech._insert_port_provisioning_block = mock.Mock()
def setUp(self): super(TestOVNMechanismDriver, self).setUp() self.plugin = mock.Mock() self.driver = mech_driver.OVNMechanismDriver() self.driver._ovn = fakes.FakeOvsdbOvnIdl()