mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
NS1: TXT records are broken if they contain spaces (#270)
* Integration tests: Add simple TXT tests. * NS1: Fix bug in TXT record handling.
This commit is contained in:
@ -236,6 +236,10 @@ func srv(name string, priority, weight, port uint16, target string) *rec {
|
||||
return r
|
||||
}
|
||||
|
||||
func txt(name, target string) *rec {
|
||||
return makeRec(name, target, "TXT")
|
||||
}
|
||||
|
||||
func caa(name string, tag string, flag uint8, target string) *rec {
|
||||
r := makeRec(name, target, "CAA")
|
||||
r.CaaFlag = flag
|
||||
@ -423,5 +427,15 @@ func makeTests(t *testing.T) []*TestCase {
|
||||
)
|
||||
}
|
||||
|
||||
// Case
|
||||
tests = append(tests, tc("Empty"),
|
||||
// TXT
|
||||
tc("Empty"),
|
||||
tc("Create a TXT", txt("foo", "simple")),
|
||||
tc("Change a TXT", txt("foo", "changed")),
|
||||
tc("Create a TXT with spaces", txt("foo", "with spaces")),
|
||||
tc("Change a TXT with spaces", txt("foo", "with whitespace")),
|
||||
)
|
||||
|
||||
return tests
|
||||
}
|
||||
|
Reference in New Issue
Block a user