mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-02-24 07:33:03 +08:00
Add integration test for large (>100 record) zones
This commit is contained in:
parent
aa5db83563
commit
7116fd9bce
1 changed files with 15 additions and 0 deletions
|
@ -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.")),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue