indirectly associated with DVR.
"""
dvr_serviced_device_owners = (n_const.DEVICE_OWNER_LOADBALANCER,
+ n_const.DEVICE_OWNER_LOADBALANCERV2,
n_const.DEVICE_OWNER_DHCP)
return (device_owner.startswith('compute:') or
device_owner in dvr_serviced_device_owners)
def test_is_dvr_serviced_with_lb_port(self):
self._test_is_dvr_serviced(constants.DEVICE_OWNER_LOADBALANCER, True)
+ def test_is_dvr_serviced_with_lbv2_port(self):
+ self._test_is_dvr_serviced(constants.DEVICE_OWNER_LOADBALANCERV2, True)
+
def test_is_dvr_serviced_with_dhcp_port(self):
self._test_is_dvr_serviced(constants.DEVICE_OWNER_DHCP, True)
self._test_port_bound_for_dvr_on_vxlan_network(
device_owner=n_const.DEVICE_OWNER_LOADBALANCER, ip_version=6)
+ def test_port_bound_for_dvr_with_lbaasv2_vip_ports(self):
+ self._test_port_bound_for_dvr_on_vlan_network(
+ device_owner=n_const.DEVICE_OWNER_LOADBALANCERV2)
+ self._test_port_bound_for_dvr_on_vlan_network(
+ device_owner=n_const.DEVICE_OWNER_LOADBALANCERV2, ip_version=6)
+ self._test_port_bound_for_dvr_on_vxlan_network(
+ device_owner=n_const.DEVICE_OWNER_LOADBALANCERV2)
+ self._test_port_bound_for_dvr_on_vxlan_network(
+ device_owner=n_const.DEVICE_OWNER_LOADBALANCERV2, ip_version=6)
+
def test_port_bound_for_dvr_with_dhcp_ports(self):
self._test_port_bound_for_dvr_on_vlan_network(
device_owner=n_const.DEVICE_OWNER_DHCP)
self._test_treat_devices_removed_for_dvr(
device_owner=n_const.DEVICE_OWNER_LOADBALANCER, ip_version=6)
+ def test_treat_devices_removed_for_dvr_with_lbaasv2_vip_ports(self):
+ self._test_treat_devices_removed_for_dvr(
+ device_owner=n_const.DEVICE_OWNER_LOADBALANCERV2)
+ self._test_treat_devices_removed_for_dvr(
+ device_owner=n_const.DEVICE_OWNER_LOADBALANCERV2, ip_version=6)
+
def test_treat_devices_removed_for_dvr_with_dhcp_ports(self):
self._test_treat_devices_removed_for_dvr(
device_owner=n_const.DEVICE_OWNER_DHCP)
self.assertTrue(utils.is_dvr_serviced(
constants.DEVICE_OWNER_LOADBALANCER))
+ def test_check_if_lbaasv2_vip_port_serviced_by_dvr(self):
+ self.assertTrue(utils.is_dvr_serviced(
+ constants.DEVICE_OWNER_LOADBALANCERV2))
+
def test_check_if_dhcp_port_serviced_by_dvr(self):
self.assertTrue(utils.is_dvr_serviced(constants.DEVICE_OWNER_DHCP))
self._test_delete_dvr_serviced_port(
device_owner=constants.DEVICE_OWNER_LOADBALANCER)
+ def test_delete_lbaasv2_vip_port(self):
+ self._test_delete_dvr_serviced_port(
+ device_owner=constants.DEVICE_OWNER_LOADBALANCERV2)
+
def test_concurrent_csnat_port_delete(self):
plugin = manager.NeutronManager.get_service_plugins()[
p_const.L3_ROUTER_NAT]
'my-subnet-id')
self.assertTrue(result)
- def test_dvr_serviced_vip_port_exists_on_subnet(self):
+ def _test_dvr_serviced_vip_port_exists_on_subnet(self, device_owner):
vip_port = {
'id': 'lbaas-vip-port1',
'device_id': 'vip-pool-id',
'status': 'ACTIVE',
'binding:host_id': 'thisHost',
- 'device_owner': constants.DEVICE_OWNER_LOADBALANCER,
+ 'device_owner': device_owner,
'fixed_ips': [
{
'subnet_id': 'my-subnet-id',
}
self._test_dvr_serviced_port_exists_on_subnet(port=vip_port)
+ def test_dvr_serviced_lbaas_vip_port_exists_on_subnet(self):
+ self._test_dvr_serviced_vip_port_exists_on_subnet(
+ device_owner=constants.DEVICE_OWNER_LOADBALANCER)
+
+ def test_dvr_serviced_lbaasv2_vip_port_exists_on_subnet(self):
+ self._test_dvr_serviced_vip_port_exists_on_subnet(
+ device_owner=constants.DEVICE_OWNER_LOADBALANCERV2)
+
def _create_port(self, port_name, tenant_id, host, subnet_id, ip_address,
status='ACTIVE',
device_owner='compute:nova'):