def _setup_dvr_ha_bridges(self): br_int_1 = self._get_agent_ovs_integration_bridge(self.agent) br_int_2 = self._get_agent_ovs_integration_bridge(self.failover_agent) veth1, veth2 = self.useFixture(net_helpers.VethFixture()).ports br_int_1.add_port(veth1.name) br_int_2.add_port(veth2.name)
def connect_to_internal_network_via_tunneling(self): veth_1, veth_2 = self.useFixture(net_helpers.VethFixture()).ports # NOTE: This sets an IP address on the host's root namespace # which is cleaned up when the device is deleted. veth_1.addr.add(common_utils.ip_to_cidr(self.local_ip, 32)) veth_1.link.set_up() veth_2.link.set_up()
def test_get_all_devices(self): # Veth is simulating the hosts eth device. In this test it is used as # src_dev for the macvtap veth1, veth2 = self.useFixture(net_helpers.VethFixture()).ports macvtap = self.useFixture( net_helpers.MacvtapFixture( src_dev=veth1.name, mode='bridge', prefix=constants.MACVTAP_DEVICE_PREFIX)).ip_dev self.assertEqual(set([macvtap.link.address]), self.mgr.get_all_devices())
def connect_to_central_network_via_tunneling(self): LOG.info('%s(): caller(): %s', log_utils.get_fname(1), log_utils.get_fname(2)) veth_1, veth_2 = self.useFixture( net_helpers.VethFixture()).ports # NOTE: This sets an IP address on the host's root namespace # which is cleaned up when the device is deleted. veth_1.addr.add(common_utils.ip_to_cidr(self.local_ip, 32)) veth_1.link.set_up() veth_2.link.set_up()
def setUp(self): super(L3HATestFailover, self).setUp() conf = self._configure_agent('agent2') self.failover_agent = neutron_l3_agent.L3NATAgentWithStateReport( 'agent2', conf) br_int_1 = self._get_agent_ovs_integration_bridge(self.agent) br_int_2 = self._get_agent_ovs_integration_bridge(self.failover_agent) veth1, veth2 = self.useFixture(net_helpers.VethFixture()).ports br_int_1.add_port(veth1.name) br_int_2.add_port(veth2.name)
def connect_to_internal_network_via_mpls_bridge(self): veth_1, veth_2 = self.useFixture(net_helpers.VethFixture()).ports veth_1.link.set_up() veth_2.link.set_up() self.mpls_bridge.add_port(veth_1.name) self.central_data_bridge.add_port(veth_2.name) mpls_device = ip_lib.IPDevice(self.mpls_bridge.br_name) mpls_device.addr.add(utils.ip_to_cidr(self.local_ip, 24)) mpls_device.link.set_up() self.mpls_bridge.remove_all_flows() self.mpls_bridge.add_flow(in_port='LOCAL', actions='output:1') self.mpls_bridge.add_flow(in_port='1', actions='output:LOCAL')
def create_veth(self): return self.useFixture(net_helpers.VethFixture()).ports