Clean-up records after TestDualProviders (#3171)

This commit is contained in:
fabienmazieres 2024-10-28 15:32:20 +00:00 committed by GitHub
parent 635eb314d2
commit 1edde6274a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -374,7 +374,7 @@ func TestDualProviders(t *testing.T) {
nslist, _ := models.ToNameservers([]string{"ns1.example.com", "ns2.example.com"})
dc.Nameservers = append(dc.Nameservers, nslist...)
nameservers.AddNSRecords(dc)
t.Log("Adding nameservers from another provider")
t.Log("Adding test nameservers")
run()
// run again to make sure no corrections
t.Log("Running again to ensure stability")
@ -392,6 +392,20 @@ func TestDualProviders(t *testing.T) {
}
t.FailNow()
}
t.Log("Removing test nameservers")
dc.Records = []*models.RecordConfig{}
n := 0
for _, ns := range dc.Nameservers {
if ns.Name == "ns1.example.com" || ns.Name == "ns2.example.com" {
continue
}
dc.Nameservers[n] = ns
n++
}
dc.Nameservers = dc.Nameservers[:n]
nameservers.AddNSRecords(dc)
run()
}
func TestNameserverDots(t *testing.T) {