1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00
Files
stackexchange-dnscontrol/pkg/js/parse_tests/029-dextendsub.js
Tom Limoncelli 063d550816 js_test.go should generate & test zonefile output too (#986)
* js_test.go: Do a zonefile test if $TESTNAME/parse_tests/{zonefile} exists.
* Add parse_tests zone files for all the tests that make sense.
* js_test.go: Addd the test datafile when displaying failures.
* 007-importTransformTTL.js: Was referring to a non-existent domain.
* 012-duration.js: Had duplicate DNS records.
* 029-dextendsub.js: Move CF-related tests to separate test.
* validate.go: Report non-existent domains as an error.
* cloudflareProvider.go: newCloudflare should not talk to the API.
2020-12-03 09:33:39 -05:00

79 lines
2.0 KiB
JavaScript

var REG = NewRegistrar("Third-Party", "NONE");
var CF = NewDnsProvider("Cloudflare", "CLOUDFLAREAPI");
// Zone that gets extended by subdomain
D("foo.net", REG, DnsProvider(CF),
A("@", "10.1.1.1"),
A("www", "10.2.2.2")
);
D_EXTEND("bar.foo.net",
A("@", "10.3.3.3"),
A("www", "10.4.4.4")
);
// Zone and subdomain zone, each get extended.
D("foo.tld", REG, DnsProvider(CF),
A("@", "20.5.5.5"),
A("www", "20.6.6.6")
);
D("bar.foo.tld", REG, DnsProvider(CF),
A("@", "30.7.7.7"),
A("www", "30.8.8.8")
);
D_EXTEND("bar.foo.tld",
A("a", "30.9.9.9")
);
D_EXTEND("foo.tld",
A("a", "20.10.10.10")
);
// Zone and subdomain zone, each get extended by a subdomain.
D("foo.help", REG, DnsProvider(CF),
A("@", "40.12.12.12"),
A("www", "40.12.12.12")
);
D("bar.foo.help", REG, DnsProvider(CF),
A("@", "50.13.13.13"),
A("www", "50.14.14.14")
);
D_EXTEND("zip.bar.foo.help",
A("@", "50.15.15.15"),
A("www", "50.16.16.16")
);
D_EXTEND("morty.foo.help",
A("@", "40.17.17.17"),
A("www", "40.18.18.18")
);
// Zone extended by a subdomain and sub-subdomain.
D("foo.here", REG, DnsProvider(CF),
A("@", "60.19.19.19"),
A("www", "60.20.20.20")
);
D_EXTEND("bar.foo.here",
A("@", "60.21.21.21"),
A("www", "60.22.22.22")
);
D_EXTEND("baz.bar.foo.here",
A("@", "60.23.23.23"),
A("www", "60.24.24.24")
);
// Zone extended by a sub-subdomain.
D_EXTEND("a.long.path.of.sub.domains.foo.net",
A("@", "10.25.25.25"),
A("www", "10.26.26.26")
);
// Zone extended by a subdomain, with absolute and relative CNAME targets
D("example.tld", REG, DnsProvider(CF));
D_EXTEND("sub.example.tld",
CNAME("a", "b"), // a.sub.example.tld -> b.sub.example.tld
CNAME("b", "@"), // a.sub.example.tld -> sub.example.tld
CNAME("c", "sub.example.tld."), // a.sub.example.tld -> sub.example.tld
//CNAME("d", "x.y"), // Error. Contains dot but doesn't end with dot.
CNAME("e", "otherdomain.tld.") // a.sub.example.tld -> otherdomain.tld
// Also test for MX, NS, ANAME, SRV.
// Not sure if PTR needs any special treatment. Haven't thought about it much.
);