'Test fixed IPs for port.
Check that configured subnets are valid prior to allocating any
IPs. Include the subnet_id in the result if only an IP address is
configured.
:raises: InvalidInput, IpAddressInUse, InvalidIpForNetwork,
InvalidIpForSubnet'

def _test_fixed_ips_for_port(self, context, network_id, fixed_ips, device_owner, subnets):

    fixed_ip_list = []
    for fixed in fixed_ips:
        subnet = self._get_subnet_for_fixed_ip(context, fixed, subnets)
        is_auto_addr_subnet = ipv6_utils.is_auto_address_subnet(subnet)
        if (('ip_address' in fixed) and (subnet['cidr'] != n_const.PROVISIONAL_IPV6_PD_PREFIX)):
            if (is_auto_addr_subnet and (device_owner not in constants.ROUTER_INTERFACE_OWNERS)):
                raise ipam_exc.AllocationOnAutoAddressSubnet(ip=fixed['ip_address'], subnet_id=subnet['id'])
            fixed_ip_list.append({'subnet_id': subnet['id'], 'ip_address': fixed['ip_address']})
        elif ((device_owner in constants.ROUTER_INTERFACE_OWNERS_SNAT) or (not is_auto_addr_subnet)):
            fixed_ip_list.append({'subnet_id': subnet['id']})
    return fixed_ip_list
