mirror of
https://github.com/google/nomulus
synced 2026-09-06 16:17:13 +00:00
Change GenerateZoneFilesAction to emit glue records only where appropriate
Previously, GenerateZoneFilesAction mapreduced its way through all domains and hosts for the specified TLD(s), emitting information for each matching domain and host (subject to constraints like not being deleted and so on). This resulted in host information (aka glue records) for all hosts subordinate to domains in the specified TLD(s). This is incorrect. DNS glue records should only be present for hosts which act as nameservers for their superordinate domains. The new version of the mapreduce iterates only over domains. When a matching domain is found, a check is made to see whether any subordinate hosts are also nameservers for the domain, in which case host information is generated. The test was updated to reflect the new reality, and check for a couple additional nuances. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=165766472
This commit is contained in:
@@ -72,6 +72,16 @@ public class GenerateZoneFilesActionTest extends MapreduceTestCase<GenerateZoneF
|
||||
|
||||
ImmutableSet<Key<HostResource>> nameservers =
|
||||
ImmutableSet.of(Key.create(host1), Key.create(host2));
|
||||
// This domain will have glue records, because it has a subordinate host which is its own
|
||||
// nameserver. None of the other domains should have glue records, because their nameservers are
|
||||
// subordinate to different domains.
|
||||
persistResource(newDomainResource("bar.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.addSubordinateHost("ns.bar.tld")
|
||||
.build());
|
||||
persistResource(newDomainResource("foo.tld").asBuilder()
|
||||
.addSubordinateHost("ns.foo.tld")
|
||||
.build());
|
||||
persistResource(newDomainResource("ns-and-ds.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
|
||||
Reference in New Issue
Block a user