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

Release 3.0.0 Candidate (#699)

Final changes before V3.0.0 release

* Remove old Gandi.  Fixes #575
* Many cleanups
* go mod tidy && go mod vendor

* integration_test.go: Output subtest name

* Cleanups

* integration_test.go: Description should include sub-test name
* Add a whitespace test to js/parse_tests/017-txt.js

* Cloudflare strips whitespace from end of TXT

* Fixes https://github.com/StackExchange/dnscontrol/issues/700

* Whitespace at end of TXT records

Name.com strips the whitespace from the end of a TXT record. There's
nothing we can do other than file a bug.

* Fixes https://github.com/StackExchange/dnscontrol/issues/701
This commit is contained in:
Tom Limoncelli
2020-03-22 13:38:37 -04:00
committed by GitHub
parent 5db21dcdec
commit 1b5935d1af
74 changed files with 153 additions and 4469 deletions

View File

@@ -139,7 +139,7 @@ func testPermitted(t *testing.T, p string, f TestGroup) error {
func makeChanges(t *testing.T, prv providers.DNSServiceProvider, dc *models.DomainConfig, tst *TestCase, desc string, expectChanges bool, origConfig map[string]string) bool {
domainName := dc.Name
return t.Run(desc, func(t *testing.T) {
return t.Run(desc+":"+tst.Desc, func(t *testing.T) {
dom, _ := dc.Copy()
for _, r := range tst.Records {
rc := models.RecordConfig(*r)
@@ -631,12 +631,18 @@ func makeTests(t *testing.T) []*TestGroup {
tc("Change a TXT", txt("foo", "changed")),
clear(),
tc("Create a TXT with spaces", txt("foo", "with spaces")),
tc("Change a TXT with spaces", txt("foo", "with whitespace ")),
tc("Create 1 TXT as array", txtmulti("foo", []string{"simple"})),
clear(),
tc("Create a 255-byte TXT", txt("foo", strings.Repeat("A", 255))),
),
testgroup("ws TXT",
not("CLOUDFLAREAPI", "NAMEDOTCOM"),
// These providers strip whitespace at the end of TXT records.
// TODO(tal): Add a check for this in normalize/validate.go
tc("Change a TXT with ws at end", txt("foo", "with space at end ")),
),
testgroup("empty TXT", not("DNSIMPLE", "CLOUDFLAREAPI"),
tc("TXT with empty str", txt("foo1", "")),
// https://github.com/StackExchange/dnscontrol/issues/598
@@ -676,10 +682,10 @@ func makeTests(t *testing.T) []*TestGroup {
testgroup("page size",
// Tests the paging code of providers. Many providers page at 100.
// Notes:
// - gandi: page size is 100, therefore we test with 99, 100, and 101
// - ns1: free acct only allows 50 records, therefore we skip
// - digitalocean: fails due to rate limiting, not page limits.
not("NS1"),
// - Gandi: page size is 100, therefore we test with 99, 100, and 101
// - NS1: free acct only allows 50 records, therefore we skip
// - DigitalOcean: fails due to rate limiting, not page limits.
not("NS1", "DIGITALOCEAN"),
tc("99 records", manyA("rec%04d", "1.2.3.4", 99)...),
tc("100 records", manyA("rec%04d", "1.2.3.4", 100)...),
tc("101 records", manyA("rec%04d", "1.2.3.4", 101)...),
@@ -745,7 +751,7 @@ func makeTests(t *testing.T) []*TestGroup {
tc("Change Weight", srv("_sip._tcp", 52, 62, 7, "foo.com."), srv("_sip._tcp", 15, 65, 75, "foo4.com.")),
tc("Change Port", srv("_sip._tcp", 52, 62, 72, "foo.com."), srv("_sip._tcp", 15, 65, 75, "foo4.com.")),
),
testgroup("SRV w/ null target", not("NAMEDOTCOM", "HEXONET", "EXOSCALE"),
testgroup("SRV w/ null target", not("EXOSCALE", "HEXONET", "NAMEDOTCOM"),
tc("Null Target", srv("_sip._tcp", 52, 62, 72, "foo.com."), srv("_sip._tcp", 15, 65, 75, ".")),
),

View File

@@ -33,7 +33,6 @@
"token": "$DO_TOKEN"
},
"DNSIMPLE": {
"COMMENT": "20-22: no ns records managable. Not even for subdomains.",
"baseurl": "https://api.sandbox.dnsimple.com",
"domain": "$DNSIMPLE_DOMAIN",
"token": "$DNSIMPLE_TOKEN"
@@ -44,16 +43,6 @@
"domain": "$EXOSCALE_DOMAIN",
"secretkey": "$EXOSCALE_SECRET_KEY"
},
"GANDI": {
"COMMENT": "5: gandi does not accept TTLs less than 300",
"apikey": "$GANDI_KEY",
"domain": "$GANDI_DOMAIN"
},
"GANDI-LIVEDNS": {
"COMMENT": "5: gandi does not accept TTLs less than 300",
"apikey": "$GANDILIVE_KEY",
"domain": "$GANDILIVE_DOMAIN"
},
"GANDI_V5": {
"apikey": "$GANDI_V5_APIKEY",
"domain": "$GANDI_V5_DOMAIN"
@@ -74,7 +63,6 @@
"ipaddress": "$HEXONET_IP"
},
"LINODE": {
"COMMENT": "25: Linode's hostname validation does not allow the target domain TLD",
"domain": "$LINODE_DOMAIN",
"token": "$LINODE_TOKEN"
},
@@ -109,7 +97,6 @@
"domain": "$R53_DOMAIN"
},
"SOFTLAYER": {
"COMMENT": "22-25 softlayer fails at direct internationalization, puncode works though",
"api_key": "$SL_API_KEY",
"domain": "$SL_DOMAIN",
"username": "$SL_USERNAME"

View File

@@ -0,0 +1,112 @@
--- PASS: TestDNSProviders/example.com/0:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/1:_Create_an_A_record (0.00s)
--- PASS: TestDNSProviders/example.com/2:_Change_it (0.00s)
--- PASS: TestDNSProviders/example.com/3:_Add_another (0.00s)
--- PASS: TestDNSProviders/example.com/4:_Add_another(same_name) (0.00s)
--- PASS: TestDNSProviders/example.com/5:_Change_a_ttl (0.00s)
--- PASS: TestDNSProviders/example.com/6:_Change_single_target_from_set (0.00s)
--- PASS: TestDNSProviders/example.com/7:_Change_all_ttls (0.00s)
--- PASS: TestDNSProviders/example.com/8:_Delete_one (0.00s)
--- PASS: TestDNSProviders/example.com/9:_Add_back_and_change_ttl (0.00s)
--- PASS: TestDNSProviders/example.com/10:_Change_targets_and_ttls (0.00s)
--- PASS: TestDNSProviders/example.com/11:_Create_wildcard (0.00s)
--- PASS: TestDNSProviders/example.com/12:_Delete_wildcard (0.00s)
--- PASS: TestDNSProviders/example.com/13:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/14:_Create_a_CNAME (0.00s)
--- PASS: TestDNSProviders/example.com/15:_Change_it (0.00s)
--- PASS: TestDNSProviders/example.com/16:_Change_to_A_record (0.00s)
--- PASS: TestDNSProviders/example.com/17:_Change_back_to_CNAME (0.00s)
--- PASS: TestDNSProviders/example.com/18:_Record_pointing_to_@ (0.00s)
--- PASS: TestDNSProviders/example.com/19:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/20:_NS_for_subdomain (0.00s)
--- PASS: TestDNSProviders/example.com/21:_Dual_NS_for_subdomain (0.00s)
--- PASS: TestDNSProviders/example.com/22:_NS_Record_pointing_to_@ (0.00s)
--- PASS: TestDNSProviders/example.com/23:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/24:_Internationalized_name (0.00s)
--- PASS: TestDNSProviders/example.com/25:_Change_IDN (0.00s)
--- PASS: TestDNSProviders/example.com/26:_Internationalized_CNAME_Target (0.00s)
--- PASS: TestDNSProviders/example.com/27:_IDN_CNAME_AND_Target (0.00s)
--- PASS: TestDNSProviders/example.com/28:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/29:_MX_record (0.00s)
--- PASS: TestDNSProviders/example.com/30:_Second_MX_record,_same_prio (0.00s)
--- PASS: TestDNSProviders/example.com/31:_3_MX (0.00s)
--- PASS: TestDNSProviders/example.com/32:_Delete_one (0.00s)
--- PASS: TestDNSProviders/example.com/33:_Change_to_other_name (0.00s)
--- PASS: TestDNSProviders/example.com/34:_Change_Preference (0.00s)
--- PASS: TestDNSProviders/example.com/35:_Record_pointing_to_@ (0.00s)
--- PASS: TestDNSProviders/example.com/36:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/37:_Create_PTR_record (0.00s)
--- PASS: TestDNSProviders/example.com/38:_Modify_PTR_record (0.00s)
--- PASS: TestDNSProviders/example.com/39:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/40:_NAPTR_record (0.00s)
--- PASS: TestDNSProviders/example.com/41:_NAPTR_second_record (0.00s)
--- PASS: TestDNSProviders/example.com/42:_NAPTR_delete_record (0.00s)
--- PASS: TestDNSProviders/example.com/43:_NAPTR_change_target (0.00s)
--- PASS: TestDNSProviders/example.com/44:_NAPTR_change_order (0.00s)
--- PASS: TestDNSProviders/example.com/45:_NAPTR_change_preference (0.00s)
--- PASS: TestDNSProviders/example.com/46:_NAPTR_change_flags (0.00s)
--- PASS: TestDNSProviders/example.com/47:_NAPTR_change_service (0.00s)
--- PASS: TestDNSProviders/example.com/48:_NAPTR_change_regexp (0.00s)
--- PASS: TestDNSProviders/example.com/49:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/50:_SRV_record (0.00s)
--- PASS: TestDNSProviders/example.com/51:_Second_SRV_record,_same_prio (0.00s)
--- PASS: TestDNSProviders/example.com/52:_3_SRV (0.00s)
--- PASS: TestDNSProviders/example.com/53:_Delete_one (0.00s)
--- PASS: TestDNSProviders/example.com/54:_Change_Target (0.00s)
--- PASS: TestDNSProviders/example.com/55:_Change_Priority (0.00s)
--- PASS: TestDNSProviders/example.com/56:_Change_Weight (0.00s)
--- PASS: TestDNSProviders/example.com/57:_Change_Port (0.00s)
--- PASS: TestDNSProviders/example.com/58:_Null_Target (0.00s)
--- PASS: TestDNSProviders/example.com/59:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/60:_SSHFP_record (0.00s)
--- PASS: TestDNSProviders/example.com/61:_SSHFP_change_algorithm (0.00s)
--- PASS: TestDNSProviders/example.com/62:_SSHFP_change_fingerprint_and_type (0.00s)
--- PASS: TestDNSProviders/example.com/63:_SSHFP_Delete_one (0.00s)
--- PASS: TestDNSProviders/example.com/64:_SSHFP_add_many_records (0.00s)
--- PASS: TestDNSProviders/example.com/65:_SSHFP_delete_two (0.00s)
--- PASS: TestDNSProviders/example.com/66:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/67:_CAA_record (0.00s)
--- PASS: TestDNSProviders/example.com/68:_CAA_change_tag (0.00s)
--- PASS: TestDNSProviders/example.com/69:_CAA_change_target (0.00s)
--- PASS: TestDNSProviders/example.com/70:_CAA_change_flag (0.00s)
--- PASS: TestDNSProviders/example.com/71:_CAA_many_records (0.00s)
--- PASS: TestDNSProviders/example.com/72:_CAA_delete (0.00s)
--- PASS: TestDNSProviders/example.com/73:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/74:_TLSA_record (0.00s)
--- PASS: TestDNSProviders/example.com/75:_TLSA_change_usage (0.00s)
--- PASS: TestDNSProviders/example.com/76:_TLSA_change_selector (0.00s)
--- PASS: TestDNSProviders/example.com/77:_TLSA_change_matchingtype (0.00s)
--- PASS: TestDNSProviders/example.com/78:_TLSA_change_certificate (0.00s)
--- PASS: TestDNSProviders/example.com/79:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/80:_Create_CAPS (0.00s)
--- PASS: TestDNSProviders/example.com/81:_Downcase_label (0.00s)
--- PASS: TestDNSProviders/example.com/82:_Downcase_target (0.00s)
--- PASS: TestDNSProviders/example.com/83:_Upcase_both (0.00s)
--- PASS: TestDNSProviders/example.com/84:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/85:_99_records (0.01s)
--- PASS: TestDNSProviders/example.com/86:_100_records (0.01s)
--- PASS: TestDNSProviders/example.com/87:_101_records (0.03s)
--- PASS: TestDNSProviders/example.com/88:_Empty (0.01s)
--- PASS: TestDNSProviders/example.com/89:_Create_a_TXT (0.03s)
--- PASS: TestDNSProviders/example.com/90:_Change_a_TXT (0.00s)
--- PASS: TestDNSProviders/example.com/91:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/92:_Create_a_TXT_with_spaces (0.00s)
--- PASS: TestDNSProviders/example.com/93:_Change_a_TXT_with_spaces (0.00s)
--- PASS: TestDNSProviders/example.com/94:_Create_1_TXT_as_array (0.01s)
--- PASS: TestDNSProviders/example.com/95:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/96:_Create_a_255-byte_TXT (0.00s)
--- PASS: TestDNSProviders/example.com/97:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/98:_Create_TXTMulti_1 (0.01s)
--- PASS: TestDNSProviders/example.com/99:_Create_TXTMulti_2 (0.01s)
--- PASS: TestDNSProviders/example.com/100:_Create_TXTMulti_3 (0.02s)
--- PASS: TestDNSProviders/example.com/101:_Create_TXTMulti_with_quotes (0.00s)
--- PASS: TestDNSProviders/example.com/102:_Change_TXTMulti (0.00s)
--- PASS: TestDNSProviders/example.com/103:_Empty (0.00s)
--- PASS: TestDNSProviders/example.com/104:_3x255-byte_TXTMulti (0.00s)
--- PASS: TestDNSProviders/example.com/105:_Empty (0.01s)
--- PASS: TestDNSProviders/example.com/106:_Create_some_records (0.00s)
--- PASS: TestDNSProviders/example.com/107:_Add_a_new_record_-_ignoring_foo (0.02s)
--- PASS: TestDNSProviders/example.com/108:_Empty (0.01s)
--- PASS: TestDNSProviders/example.com/109:_Create_some_records (0.01s)
--- PASS: TestDNSProviders/example.com/110:_Add_a_new_record_-_ignoring_*.foo (0.00s)
--- PASS: TestDNSProviders/example.com/111:_Empty (0.01s)