def test__dynamic_range_cannot_overlap_user_reserved_address(self):
subnet = make_plain_subnet()
factory.make_StaticIPAddress(
subnet=subnet,
alloc_type=IPADDRESS_TYPE.USER_RESERVED,
ip=factory.pick_ip_in_network(
IPNetwork(subnet.cidr),
but_not=['192.168.0.1']))
iprange = IPRange(
subnet=subnet,
type=IPRANGE_TYPE.DYNAMIC,
start_ip="192.168.0.2",
end_ip="192.168.0.254",
)
with ExpectedException(ValidationError, self.dynamic_overlaps):
iprange.save()
# Regression for lp:1580772.
评论列表
文章目录