Merge "[Fullstack] Remove central_external_bridge"
This commit is contained in:
commit
c563530af5
Binary file not shown.
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 41 KiB |
|
@ -92,15 +92,13 @@ class Host(fixtures.Fixture):
|
||||||
and disconnects the host from other hosts.
|
and disconnects the host from other hosts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, env_desc, host_desc,
|
def __init__(self, env_desc, host_desc, test_name,
|
||||||
test_name, neutron_config,
|
neutron_config, central_bridge):
|
||||||
central_data_bridge, central_external_bridge):
|
|
||||||
self.env_desc = env_desc
|
self.env_desc = env_desc
|
||||||
self.host_desc = host_desc
|
self.host_desc = host_desc
|
||||||
self.test_name = test_name
|
self.test_name = test_name
|
||||||
self.neutron_config = neutron_config
|
self.neutron_config = neutron_config
|
||||||
self.central_data_bridge = central_data_bridge
|
self.central_bridge = central_bridge
|
||||||
self.central_external_bridge = central_external_bridge
|
|
||||||
self.host_namespace = None
|
self.host_namespace = None
|
||||||
self.agents = {}
|
self.agents = {}
|
||||||
# we need to cache already created "per network" bridges if linuxbridge
|
# we need to cache already created "per network" bridges if linuxbridge
|
||||||
|
@ -141,12 +139,12 @@ class Host(fixtures.Fixture):
|
||||||
self.useFixture(
|
self.useFixture(
|
||||||
net_helpers.OVSBridgeFixture(
|
net_helpers.OVSBridgeFixture(
|
||||||
agent_cfg_fixture.get_br_tun_name())).bridge
|
agent_cfg_fixture.get_br_tun_name())).bridge
|
||||||
self.connect_to_internal_network_via_tunneling()
|
self.connect_to_central_network_via_tunneling()
|
||||||
else:
|
else:
|
||||||
self.br_phys = self.useFixture(
|
self.br_phys = self.useFixture(
|
||||||
net_helpers.OVSBridgeFixture(
|
net_helpers.OVSBridgeFixture(
|
||||||
agent_cfg_fixture.get_br_phys_name())).bridge
|
agent_cfg_fixture.get_br_phys_name())).bridge
|
||||||
self.connect_to_internal_network_via_vlans(self.br_phys)
|
self.connect_to_central_network_via_vlans(self.br_phys)
|
||||||
|
|
||||||
self.ovs_agent = self.useFixture(
|
self.ovs_agent = self.useFixture(
|
||||||
process.OVSAgentFixture(
|
process.OVSAgentFixture(
|
||||||
|
@ -162,7 +160,7 @@ class Host(fixtures.Fixture):
|
||||||
br_ex = self.useFixture(
|
br_ex = self.useFixture(
|
||||||
net_helpers.OVSBridgeFixture(
|
net_helpers.OVSBridgeFixture(
|
||||||
self.l3_agent_cfg_fixture.get_external_bridge())).bridge
|
self.l3_agent_cfg_fixture.get_external_bridge())).bridge
|
||||||
self.connect_to_external_network(br_ex)
|
self.connect_to_central_network_via_vlans(br_ex)
|
||||||
|
|
||||||
if self.host_desc.dhcp_agent:
|
if self.host_desc.dhcp_agent:
|
||||||
self.dhcp_agent_cfg_fixture = self.useFixture(
|
self.dhcp_agent_cfg_fixture = self.useFixture(
|
||||||
|
@ -211,7 +209,7 @@ class Host(fixtures.Fixture):
|
||||||
def _connect_ovs_port(self, cidr_address):
|
def _connect_ovs_port(self, cidr_address):
|
||||||
ovs_device = self.useFixture(
|
ovs_device = self.useFixture(
|
||||||
net_helpers.OVSPortFixture(
|
net_helpers.OVSPortFixture(
|
||||||
bridge=self.central_data_bridge,
|
bridge=self.central_bridge,
|
||||||
namespace=self.host_namespace)).port
|
namespace=self.host_namespace)).port
|
||||||
# NOTE: This sets an IP address on the host's root namespace
|
# NOTE: This sets an IP address on the host's root namespace
|
||||||
# which is cleaned up when the device is deleted.
|
# which is cleaned up when the device is deleted.
|
||||||
|
@ -224,7 +222,7 @@ class Host(fixtures.Fixture):
|
||||||
)
|
)
|
||||||
self.host_port.link.set_up()
|
self.host_port.link.set_up()
|
||||||
|
|
||||||
def connect_to_internal_network_via_tunneling(self):
|
def connect_to_central_network_via_tunneling(self):
|
||||||
veth_1, veth_2 = self.useFixture(
|
veth_1, veth_2 = self.useFixture(
|
||||||
net_helpers.VethFixture()).ports
|
net_helpers.VethFixture()).ports
|
||||||
|
|
||||||
|
@ -235,15 +233,11 @@ class Host(fixtures.Fixture):
|
||||||
veth_1.link.set_up()
|
veth_1.link.set_up()
|
||||||
veth_2.link.set_up()
|
veth_2.link.set_up()
|
||||||
|
|
||||||
def connect_to_internal_network_via_vlans(self, host_data_bridge):
|
def connect_to_central_network_via_vlans(self, host_data_bridge):
|
||||||
# If using VLANs as a segmentation device, it's needed to connect
|
# If using VLANs as a segmentation device, it's needed to connect
|
||||||
# a provider bridge to a centralized, shared bridge.
|
# a provider bridge to a centralized, shared bridge.
|
||||||
net_helpers.create_patch_ports(
|
net_helpers.create_patch_ports(
|
||||||
self.central_data_bridge, host_data_bridge)
|
self.central_bridge, host_data_bridge)
|
||||||
|
|
||||||
def connect_to_external_network(self, host_external_bridge):
|
|
||||||
net_helpers.create_patch_ports(
|
|
||||||
self.central_external_bridge, host_external_bridge)
|
|
||||||
|
|
||||||
def allocate_local_ip(self):
|
def allocate_local_ip(self):
|
||||||
if not self.env_desc.network_range:
|
if not self.env_desc.network_range:
|
||||||
|
@ -361,17 +355,14 @@ class Environment(fixtures.Fixture):
|
||||||
host_desc,
|
host_desc,
|
||||||
self.test_name,
|
self.test_name,
|
||||||
neutron_config,
|
neutron_config,
|
||||||
self.central_data_bridge,
|
self.central_bridge))
|
||||||
self.central_external_bridge))
|
|
||||||
|
|
||||||
def _setUp(self):
|
def _setUp(self):
|
||||||
self.temp_dir = self.useFixture(fixtures.TempDir()).path
|
self.temp_dir = self.useFixture(fixtures.TempDir()).path
|
||||||
|
|
||||||
# we need this bridge before rabbit and neutron service will start
|
# we need this bridge before rabbit and neutron service will start
|
||||||
self.central_data_bridge = self.useFixture(
|
self.central_bridge = self.useFixture(
|
||||||
net_helpers.OVSBridgeFixture('cnt-data')).bridge
|
net_helpers.OVSBridgeFixture('cnt-data')).bridge
|
||||||
self.central_external_bridge = self.useFixture(
|
|
||||||
net_helpers.OVSBridgeFixture('cnt-ex')).bridge
|
|
||||||
|
|
||||||
# Get rabbitmq address (and cnt-data network)
|
# Get rabbitmq address (and cnt-data network)
|
||||||
rabbitmq_ip_address = self._configure_port_for_rabbitmq()
|
rabbitmq_ip_address = self._configure_port_for_rabbitmq()
|
||||||
|
@ -401,7 +392,7 @@ class Environment(fixtures.Fixture):
|
||||||
if not self.env_desc.network_range:
|
if not self.env_desc.network_range:
|
||||||
return "127.0.0.1"
|
return "127.0.0.1"
|
||||||
rabbitmq_ip = str(self.env_desc.network_range[1])
|
rabbitmq_ip = str(self.env_desc.network_range[1])
|
||||||
rabbitmq_port = ip_lib.IPDevice(self.central_data_bridge.br_name)
|
rabbitmq_port = ip_lib.IPDevice(self.central_bridge.br_name)
|
||||||
rabbitmq_port.addr.add(common_utils.ip_to_cidr(rabbitmq_ip, 24))
|
rabbitmq_port.addr.add(common_utils.ip_to_cidr(rabbitmq_ip, 24))
|
||||||
rabbitmq_port.link.set_up()
|
rabbitmq_port.link.set_up()
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ class TestLegacyL3Agent(TestL3Agent):
|
||||||
|
|
||||||
def test_north_south_traffic(self):
|
def test_north_south_traffic(self):
|
||||||
# This function creates an external network which is connected to
|
# This function creates an external network which is connected to
|
||||||
# central_external_bridge and spawns an external_vm on it.
|
# central_bridge and spawns an external_vm on it.
|
||||||
# The external_vm is configured with the gateway_ip (both v4 & v6
|
# The external_vm is configured with the gateway_ip (both v4 & v6
|
||||||
# addresses) of external subnet. Later, it creates a tenant router,
|
# addresses) of external subnet. Later, it creates a tenant router,
|
||||||
# a tenant network and two tenant subnets (v4 and v6). The tenant
|
# a tenant network and two tenant subnets (v4 and v6). The tenant
|
||||||
|
@ -169,7 +169,7 @@ class TestLegacyL3Agent(TestL3Agent):
|
||||||
ext_net, ext_sub = self._create_external_network_and_subnet(tenant_id)
|
ext_net, ext_sub = self._create_external_network_and_subnet(tenant_id)
|
||||||
external_vm = self.useFixture(
|
external_vm = self.useFixture(
|
||||||
machine_fixtures.FakeMachine(
|
machine_fixtures.FakeMachine(
|
||||||
self.environment.central_external_bridge,
|
self.environment.central_bridge,
|
||||||
common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
|
common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
|
||||||
# Create an IPv6 subnet in the external network
|
# Create an IPv6 subnet in the external network
|
||||||
v6network = self.useFixture(
|
v6network = self.useFixture(
|
||||||
|
@ -213,7 +213,7 @@ class TestLegacyL3Agent(TestL3Agent):
|
||||||
br_phys = self.environment.hosts[0].br_phys
|
br_phys = self.environment.hosts[0].br_phys
|
||||||
br_phys.destroy()
|
br_phys.destroy()
|
||||||
br_phys.create()
|
br_phys.create()
|
||||||
self.environment.hosts[0].connect_to_internal_network_via_vlans(
|
self.environment.hosts[0].connect_to_central_network_via_vlans(
|
||||||
br_phys)
|
br_phys)
|
||||||
|
|
||||||
# ping floating ip from external vm
|
# ping floating ip from external vm
|
||||||
|
@ -343,7 +343,7 @@ class TestHAL3Agent(TestL3Agent):
|
||||||
|
|
||||||
external_vm = self.useFixture(
|
external_vm = self.useFixture(
|
||||||
machine_fixtures.FakeMachine(
|
machine_fixtures.FakeMachine(
|
||||||
self.environment.central_external_bridge,
|
self.environment.central_bridge,
|
||||||
common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
|
common_utils.ip_to_cidr(ext_sub['gateway_ip'], 24)))
|
||||||
|
|
||||||
common_utils.wait_until_true(
|
common_utils.wait_until_true(
|
||||||
|
|
Loading…
Reference in New Issue