# be started for the router attached to the network
if self.conf.enable_metadata_network:
router_ports = [port for port in network.ports
- if (port.device_owner ==
- constants.DEVICE_OWNER_ROUTER_INTF)]
+ if (port.device_owner in
+ constants.ROUTER_INTERFACE_OWNERS)]
if router_ports:
# Multiple router ports should not be allowed
if len(router_ports) > 1:
device_id='forzanapoli',
fixed_ips=[fake_meta_fixed_ip]))
+fake_meta_dvr_port = dhcp.DictModel(fake_meta_port.copy())
+fake_meta_dvr_port.device_owner = const.DEVICE_OWNER_DVR_INTERFACE
+
fake_dist_port = dhcp.DictModel(dict(id='12345678-1234-aaaa-1234567890ab',
mac_address='aa:bb:cc:dd:ee:ff',
network_id='12345678-1234-5678-1234567890ab',
subnets=[fake_meta_subnet],
ports=[fake_meta_port]))
+fake_meta_dvr_network = dhcp.NetModel(True, fake_meta_network.copy())
+fake_meta_dvr_network.ports = [fake_meta_dvr_port]
+
fake_dist_network = dhcp.NetModel(
True, dict(id='12345678-1234-5678-1234567890ab',
tenant_id='aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa',
def test_enable_isolated_metadata_proxy_with_metadata_network(self):
self._test_metadata_network(fake_meta_network)
+ def test_enable_isolated_metadata_proxy_with_metadata_network_dvr(self):
+ self._test_metadata_network(fake_meta_dvr_network)
+
def test_enable_isolated_metadata_proxy_with_dist_network(self):
self._test_metadata_network(fake_dist_network)