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

Move IGNORE* tests to the end (#1623)

This commit is contained in:
Tom Limoncelli
2022-07-14 12:50:10 -04:00
committed by GitHub
parent f877549ca5
commit 9b42764419

View File

@@ -790,66 +790,6 @@ func makeTests(t *testing.T) []*TestGroup {
tc("NS Record pointing to @", a("@", "1.2.3.4"), ns("foo", "**current-domain**")),
),
testgroup("IGNORE_NAME function",
tc("Create some records",
txt("foo", "simple"),
a("foo", "1.2.3.4"),
),
tc("Add a new record - ignoring foo",
a("bar", "1.2.3.4"),
ignoreName("foo"),
),
clear(),
tc("Create some records",
txt("bar.foo", "simple"),
a("bar.foo", "1.2.3.4"),
),
tc("Add a new record - ignoring *.foo",
a("bar", "1.2.3.4"),
ignoreName("*.foo"),
),
),
testgroup("IGNORE_NAME apex",
tc("Create some records",
txt("@", "simple"),
a("@", "1.2.3.4"),
txt("bar", "stringbar"),
a("bar", "2.4.6.8"),
),
tc("Add a new record - ignoring apex",
txt("bar", "stringbar"),
a("bar", "2.4.6.8"),
a("added", "4.6.8.9"),
ignoreName("@"),
),
),
testgroup("IGNORE_TARGET function",
tc("Create some records",
cname("foo", "test.foo.com."),
cname("bar", "test.bar.com."),
),
tc("Add a new record - ignoring test.foo.com.",
cname("bar", "bar.foo.com."),
ignoreTarget("test.foo.com.", "CNAME"),
),
clear(),
tc("Create some records",
cname("bar.foo", "a.b.foo.com."),
a("test.foo", "1.2.3.4"),
),
tc("Add a new record - ignoring **.foo.com. targets",
a("bar", "1.2.3.4"),
ignoreTarget("**.foo.com.", "CNAME"),
),
),
// NB(tlim): We don't have a test for IGNORE_TARGET at the apex
// because IGNORE_TARGET only works on CNAMEs and you can't have a
// CNAME at the apex. If we extend IGNORE_TARGET to support other
// types of records, we should add a test at the apex.
testgroup("simple TXT",
tc("Create a TXT", txt("foo", "simple")),
tc("Change a TXT", txt("foo", "changed")),
@@ -1487,6 +1427,66 @@ func makeTests(t *testing.T) []*TestGroup {
cfWorkerRoute("api.**current-domain-no-trailing**/cnn/*", "dnscontrol_integrationtest_cnn"),
),
),
testgroup("IGNORE_NAME function",
tc("Create some records",
txt("foo", "simple"),
a("foo", "1.2.3.4"),
),
tc("Add a new record - ignoring foo",
a("bar", "1.2.3.4"),
ignoreName("foo"),
),
clear(),
tc("Create some records",
txt("bar.foo", "simple"),
a("bar.foo", "1.2.3.4"),
),
tc("Add a new record - ignoring *.foo",
a("bar", "1.2.3.4"),
ignoreName("*.foo"),
),
),
testgroup("IGNORE_NAME apex",
tc("Create some records",
txt("@", "simple"),
a("@", "1.2.3.4"),
txt("bar", "stringbar"),
a("bar", "2.4.6.8"),
),
tc("Add a new record - ignoring apex",
txt("bar", "stringbar"),
a("bar", "2.4.6.8"),
a("added", "4.6.8.9"),
ignoreName("@"),
),
),
testgroup("IGNORE_TARGET function",
tc("Create some records",
cname("foo", "test.foo.com."),
cname("bar", "test.bar.com."),
),
tc("Add a new record - ignoring test.foo.com.",
cname("bar", "bar.foo.com."),
ignoreTarget("test.foo.com.", "CNAME"),
),
clear(),
tc("Create some records",
cname("bar.foo", "a.b.foo.com."),
a("test.foo", "1.2.3.4"),
),
tc("Add a new record - ignoring **.foo.com. targets",
a("bar", "1.2.3.4"),
ignoreTarget("**.foo.com.", "CNAME"),
),
),
// NB(tlim): We don't have a test for IGNORE_TARGET at the apex
// because IGNORE_TARGET only works on CNAMEs and you can't have a
// CNAME at the apex. If we extend IGNORE_TARGET to support other
// types of records, we should add a test at the apex.
}
return tests