sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #04142
Re: [Merge] ~cgrabowski/maas:ensure_all_reverse_dns_records_are_accounted_for into maas:master
Diff comments:
> diff --git a/src/maasserver/dns/tests/test_zonegenerator.py b/src/maasserver/dns/tests/test_zonegenerator.py
> index 5a3aee1..f09ebdf 100644
> --- a/src/maasserver/dns/tests/test_zonegenerator.py
> +++ b/src/maasserver/dns/tests/test_zonegenerator.py
> @@ -510,6 +511,50 @@ class TestZoneGenerator(MAASServerTestCase):
> }
> self.assertEqual(expected_map, zones[0]._other_mapping)
>
> + def test_glue_receives_correct_dynamic_updates(self):
> + domain = factory.make_Domain()
> + subnet = factory.make_Subnet(cidr=str(IPNetwork("10/29").cidr))
> + sip = factory.make_StaticIPAddress(subnet=subnet)
> + factory.make_Node_with_Interface_on_Subnet(
> + subnet=subnet, vlan=subnet.vlan, fabric=subnet.vlan.fabric
> + )
> + update_rec = factory.make_DNSResource(
> + name=factory.make_name(), domain=domain, ip_addresses=[sip]
> + )
> + updates = [
> + DynamicDNSUpdate(
> + operation="INSERT",
> + name=update_rec.name,
> + zone=domain.name,
> + rectype="A",
> + answer=sip.ip,
> + )
> + ]
> + zones = ZoneGenerator(
> + domain,
> + subnet,
> + serial=random.randint(0, 65535),
> + dynamic_updates=updates,
> + ).as_list()
> + print(zones[0])
will remove
> + self.assertCountEqual(zones[0]._dynamic_updates, updates)
> + self.assertCountEqual(
> + zones[1]._dynamic_updates,
> + [
> + DynamicDNSUpdate.as_reverse_record_update(
> + updates[0], str(IPNetwork("10/29"))
> + )
> + ],
> + )
> + self.assertCountEqual(
> + zones[2]._dynamic_updates,
> + [
> + DynamicDNSUpdate.as_reverse_record_update(
> + updates[0], str(IPNetwork("10/24"))
> + )
> + ],
> + )
> +
> def test_parent_of_default_domain_gets_glue(self):
> default_domain = Domain.objects.get_default_domain()
> default_domain.name = "maas.example.com"
--
https://code.launchpad.net/~cgrabowski/maas/+git/maas/+merge/434659
Your team MAAS Committers is subscribed to branch maas:master.
References