1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Make PTR more magical (#148)

* Initial code and tests
This commit is contained in:
Tom Limoncelli
2017-07-07 13:59:29 -04:00
committed by GitHub
parent 152892f62a
commit 582e5c2bb1
8 changed files with 214 additions and 2 deletions

View File

@ -219,6 +219,10 @@ func mx(name string, prio uint16, target string) *rec {
return r
}
func ptr(name, target string) *rec {
return makeRec(name, target, "PTR")
}
func makeRec(name, target, typ string) *rec {
return &rec{
Name: name,
@ -288,6 +292,11 @@ var tests = []*TestCase{
tc("Change to other name", mx("@", 5, "foo2.com."), mx("mail", 15, "foo3.com.")),
tc("Change Priority", mx("@", 7, "foo2.com."), mx("mail", 15, "foo3.com.")),
//PTR
tc("Empty"),
tc("Create PTR record", ptr("4", "foo.com.")),
tc("Modify PTR record", ptr("4", "bar.com.")),
//ALIAS
tc("EMPTY"),
tc("ALIAS at root", alias("@", "foo.com.")).IfHasCapability(providers.CanUseAlias),