mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Add integration test for TXT records longer than 255 characters
This commit is contained in:
@ -438,7 +438,7 @@ func ignoreName(name string) *rec {
|
|||||||
|
|
||||||
func ignoreTarget(name string, typ string) *rec {
|
func ignoreTarget(name string, typ string) *rec {
|
||||||
r := &rec{
|
r := &rec{
|
||||||
Type: "IGNORE_TARGET",
|
Type: "IGNORE_TARGET",
|
||||||
Target: typ,
|
Target: typ,
|
||||||
}
|
}
|
||||||
r.SetLabel(name, "**current-domain**")
|
r.SetLabel(name, "**current-domain**")
|
||||||
@ -509,16 +509,16 @@ func tc(desc string, recs ...*rec) *TestCase {
|
|||||||
} else if r.Type == "IGNORE_TARGET" {
|
} else if r.Type == "IGNORE_TARGET" {
|
||||||
ignoredTargets = append(ignoredTargets, &models.IgnoreTarget{
|
ignoredTargets = append(ignoredTargets, &models.IgnoreTarget{
|
||||||
Pattern: r.GetLabel(),
|
Pattern: r.GetLabel(),
|
||||||
Type: r.Target,
|
Type: r.Target,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
records = append(records, r)
|
records = append(records, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &TestCase{
|
return &TestCase{
|
||||||
Desc: desc,
|
Desc: desc,
|
||||||
Records: records,
|
Records: records,
|
||||||
IgnoredNames: ignoredNames,
|
IgnoredNames: ignoredNames,
|
||||||
IgnoredTargets: ignoredTargets,
|
IgnoredTargets: ignoredTargets,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -874,6 +874,12 @@ func makeTests(t *testing.T) []*TestGroup {
|
|||||||
txtmulti("foo3", []string{strings.Repeat("X", 255), strings.Repeat("Y", 255), strings.Repeat("Z", 255)})),
|
txtmulti("foo3", []string{strings.Repeat("X", 255), strings.Repeat("Y", 255), strings.Repeat("Z", 255)})),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
testgroup("TXTLong",
|
||||||
|
requires(providers.CanUseTXTMulti),
|
||||||
|
only("HEDNS"),
|
||||||
|
tc("TXT longer than 255 bytes", txt("foo1", strings.Repeat("X", 256))),
|
||||||
|
),
|
||||||
|
|
||||||
testgroup("DS",
|
testgroup("DS",
|
||||||
requires(providers.CanUseDS),
|
requires(providers.CanUseDS),
|
||||||
tc("create DS", ds("@", 1, 13, 1, "ADIGEST")),
|
tc("create DS", ds("@", 1, 13, 1, "ADIGEST")),
|
||||||
|
Reference in New Issue
Block a user