watcher tests: far fewer live queries, longer live attempts (closes #214)
check / check (push) Successful in 1m11s
check / check (push) Successful in 1m11s
A domain check looked up each nameserver's addresses by asking every nameserver of that name's zone for all eight record types; it now asks only for A, AAAA and CNAME, the ones it reads. The watcher tests now check example.org instead of cloudflare.com (two nameservers instead of five) and desec.io instead of example.com (its nameservers are in zones with two, not cloudflare.com's five). The record change and NS failure tests start from saved state built on one NS lookup instead of a first full check, and the port change test runs only the port checks again. A live test attempt may take 18 seconds, not 8. A new live test checks that a nameserver's addresses include IPv4 and IPv6. Model: opus-5-5
This commit was merged in pull request #215.
This commit is contained in:
@@ -562,6 +562,34 @@ func TestResolveIPAddresses_CloudflareDomain(t *testing.T) {
|
||||
assert.NotEmpty(t, ips)
|
||||
}
|
||||
|
||||
// TestResolveIPAddresses_NameserverIPv4AndIPv6 looks up the addresses of
|
||||
// one of cloudflare.com's nameservers, as a domain check does for each
|
||||
// nameserver. That name has A and AAAA records, so both kinds of address
|
||||
// come back.
|
||||
func TestResolveIPAddresses_NameserverIPv4AndIPv6(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
r := newTestResolver(t)
|
||||
ns := findOneNSForDomain(t, r, "cloudflare.com")
|
||||
ips := liveResolveIPs(t, r, ns)
|
||||
|
||||
var ipv4, ipv6 int
|
||||
|
||||
for _, ip := range ips {
|
||||
parsed := net.ParseIP(ip)
|
||||
require.NotNil(t, parsed, "should be valid IP: %s", ip)
|
||||
|
||||
if parsed.To4() != nil {
|
||||
ipv4++
|
||||
} else {
|
||||
ipv6++
|
||||
}
|
||||
}
|
||||
|
||||
assert.Positive(t, ipv4, "no IPv4 address for %s: %v", ns, ips)
|
||||
assert.Positive(t, ipv6, "no IPv6 address for %s: %v", ns, ips)
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// Context cancellation tests
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user