mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Add integration test for large (>100 record) zones
This commit is contained in:
@@ -267,6 +267,14 @@ func tc(desc string, recs ...*rec) *TestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func manyA(namePattern, target string, n int) []*rec {
|
||||||
|
recs := []*rec{}
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
|
recs = append(recs, makeRec(fmt.Sprintf(namePattern, i), target, "A"))
|
||||||
|
}
|
||||||
|
return recs
|
||||||
|
}
|
||||||
|
|
||||||
func (tc *TestCase) IfHasCapability(c providers.Capability) *TestCase {
|
func (tc *TestCase) IfHasCapability(c providers.Capability) *TestCase {
|
||||||
tc.SkipUnless = c
|
tc.SkipUnless = c
|
||||||
return tc
|
return tc
|
||||||
@@ -349,6 +357,13 @@ var tests = []*TestCase{
|
|||||||
tc("CAA many records", caa("@", "issue", 0, "letsencrypt.org"), caa("@", "issuewild", 0, ";"), caa("@", "iodef", 1, "mailto:test@example.com")).IfHasCapability(providers.CanUseCAA),
|
tc("CAA many records", caa("@", "issue", 0, "letsencrypt.org"), caa("@", "issuewild", 0, ";"), caa("@", "iodef", 1, "mailto:test@example.com")).IfHasCapability(providers.CanUseCAA),
|
||||||
tc("CAA delete", caa("@", "issue", 0, "letsencrypt.org")).IfHasCapability(providers.CanUseCAA),
|
tc("CAA delete", caa("@", "issue", 0, "letsencrypt.org")).IfHasCapability(providers.CanUseCAA),
|
||||||
|
|
||||||
|
// Test large zonefiles.
|
||||||
|
// Gandi pages 100 items at a time.
|
||||||
|
tc("Empty"),
|
||||||
|
tc("99 records", manyA("rec%04d", "1.2.3.4", 99)...),
|
||||||
|
tc("100 records", manyA("rec%04d", "1.2.3.4", 100)...),
|
||||||
|
tc("101 records", manyA("rec%04d", "1.2.3.4", 101)...),
|
||||||
|
|
||||||
//TODO: in validation, check that everything is given in unicode. This case hurts too much.
|
//TODO: in validation, check that everything is given in unicode. This case hurts too much.
|
||||||
//tc("IDN pre-punycoded", cname("xn--o-0gab", "xn--o-0gab.xn--o-0gab.")),
|
//tc("IDN pre-punycoded", cname("xn--o-0gab", "xn--o-0gab.xn--o-0gab.")),
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user