diff --git a/internal/watcher/dnsunreachable_test.go b/internal/watcher/dnsunreachable_test.go index 7a2eecb..66698d7 100644 --- a/internal/watcher/dnsunreachable_test.go +++ b/internal/watcher/dnsunreachable_test.go @@ -8,18 +8,18 @@ import ( "sneak.berlin/go/dnswatcher/internal/watcher" ) -// TestDNSUnreachableWhenNoRootServerReplies runs one round of checks of -// a domain and a hostname with every walk starting at real servers that -// are not root servers. At 192.0.2.1, a documentation address, nothing -// answers, as when no root server answers. Public recursive resolvers of -// four operators mark their replies recursion available, as on a network -// that intercepts DNS queries; one that gives no reply is passed over -// for the next, and if none replies, no root server answered. Either -// way every lookup failed because no root server gave a usable reply, -// so the round could not reach the DNS. TestFirstRunBaseline and -// TestDomainThatDoesNotExist check rounds in which the root servers -// gave a usable reply. -func TestDNSUnreachableWhenNoRootServerReplies(t *testing.T) { +// TestDNSUnreachableWhenNoRootServerGivesUsableReply runs one round of +// checks of a domain and a hostname with every walk starting at real +// servers that are not root servers. At 192.0.2.1, a documentation +// address, nothing answers, as when no root server answers. Public +// recursive resolvers of four operators mark their replies recursion +// available, as on a network that intercepts DNS queries; one that gives +// no reply is passed over for the next, and if none replies, no root +// server answered. Either way every lookup failed because no root server +// gave a usable reply, so the round could not reach the DNS. +// TestFirstRunBaseline and TestDomainThatDoesNotExist check rounds in +// which the root servers gave a usable reply. +func TestDNSUnreachableWhenNoRootServerGivesUsableReply(t *testing.T) { t.Parallel() tests := []struct { diff --git a/internal/watcher/watcher.go b/internal/watcher/watcher.go index 64be30b..9550a87 100644 --- a/internal/watcher/watcher.go +++ b/internal/watcher/watcher.go @@ -299,16 +299,16 @@ func (w *Watcher) runDNSChecks(ctx context.Context) { } if ctx.Err() == nil { - w.dnsUnreachable.Store(noRootServerReplied(errs)) + w.dnsUnreachable.Store(noRootServerGaveUsableReply(errs)) } } -// noRootServerReplied reports whether errs, the errors of the lookups in -// a round of DNS checks, nil for a lookup that succeeded, show that -// every lookup failed because no root server gave a usable reply: each -// is ErrNoRootServerAnswered or ErrIntercepted. A round with no lookups -// shows nothing. -func noRootServerReplied(errs []error) bool { +// noRootServerGaveUsableReply reports whether errs, the errors of the +// lookups in a round of DNS checks, nil for a lookup that succeeded, +// show that every lookup failed because no root server gave a usable +// reply: each is ErrNoRootServerAnswered or ErrIntercepted. A round with +// no lookups shows nothing. +func noRootServerGaveUsableReply(errs []error) bool { for _, err := range errs { if !errors.Is(err, resolver.ErrNoRootServerAnswered) && !errors.Is(err, resolver.ErrIntercepted) {