TESTING: add integration test for no trailing dot in nameservers (#2311)

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
Jakob Ackermann 2023-05-02 20:40:33 +01:00 committed by GitHub
parent 489be2e3dc
commit f0ea71584f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -319,6 +319,14 @@ func runTests(t *testing.T, prv providers.DNSServiceProvider, domainName string,
}
// Issue https://github.com/StackExchange/dnscontrol/issues/491
t.Run("No trailing dot in nameserver", func(t *testing.T) {
for _, nameserver := range dc.Nameservers {
if strings.HasSuffix(nameserver.Name, ".") {
t.Errorf("Provider returned nameserver with trailing dot: %s (See issue https://github.com/StackExchange/dnscontrol/issues/491, TL;DR: use models.ToNameserversStripTD in GetNameservers)", nameserver)
}
}
})
}
func TestDualProviders(t *testing.T) {