mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
refactor into groups (#684)
* Refactor tests into "groups", each with its own filter (not/only/requires) to select which providers are appropriate. * Test driver code is now a lot more simple and clear. * Add support for not(), only(), and requires() as a way to select/reject providers for a test. * Add docs explaining how to add tests * Logging messages are much cleaner now, especially when tests are skipped. * -start and -end now refer to test groups, not individual tests. Log messages list the group numbers clearly. * Add stringer for Capabilities * Change the order of the tests so that simple tests are first * Removed knownFailures from providers.json * fmtjson providers.json Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
//go:generate stringer -type=Capability
|
||||
|
||||
package providers
|
||||
|
||||
import (
|
||||
|
38
providers/capability_string.go
Normal file
38
providers/capability_string.go
Normal file
@@ -0,0 +1,38 @@
|
||||
// Code generated by "stringer -type=Capability"; DO NOT EDIT.
|
||||
|
||||
package providers
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[CanUseAlias-0]
|
||||
_ = x[CanUseCAA-1]
|
||||
_ = x[CanUsePTR-2]
|
||||
_ = x[CanUseNAPTR-3]
|
||||
_ = x[CanUseSRV-4]
|
||||
_ = x[CanUseSSHFP-5]
|
||||
_ = x[CanUseTLSA-6]
|
||||
_ = x[CanUseTXTMulti-7]
|
||||
_ = x[CanAutoDNSSEC-8]
|
||||
_ = x[CantUseNOPURGE-9]
|
||||
_ = x[DocOfficiallySupported-10]
|
||||
_ = x[DocDualHost-11]
|
||||
_ = x[DocCreateDomains-12]
|
||||
_ = x[CanUseRoute53Alias-13]
|
||||
_ = x[CanGetZones-14]
|
||||
_ = x[CanUseAzureAlias-15]
|
||||
}
|
||||
|
||||
const _Capability_name = "CanUseAliasCanUseCAACanUsePTRCanUseNAPTRCanUseSRVCanUseSSHFPCanUseTLSACanUseTXTMultiCanAutoDNSSECCantUseNOPURGEDocOfficiallySupportedDocDualHostDocCreateDomainsCanUseRoute53AliasCanGetZonesCanUseAzureAlias"
|
||||
|
||||
var _Capability_index = [...]uint8{0, 11, 20, 29, 40, 49, 60, 70, 84, 97, 111, 133, 144, 160, 178, 189, 205}
|
||||
|
||||
func (i Capability) String() string {
|
||||
if i >= Capability(len(_Capability_index)-1) {
|
||||
return "Capability(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _Capability_name[_Capability_index[i]:_Capability_index[i+1]]
|
||||
}
|
@@ -40,7 +40,7 @@ func init() {
|
||||
|
||||
// features declares which features and options are available.
|
||||
var features = providers.DocumentationNotes{
|
||||
providers.CanUseAlias: providers.Can(),
|
||||
providers.CanUseAlias: providers.Can("Only on the bare domain. Otherwise CNAME will be substituted"),
|
||||
providers.CanUseCAA: providers.Can(),
|
||||
providers.CanUsePTR: providers.Can(),
|
||||
providers.CanUseSRV: providers.Can(),
|
||||
@@ -155,6 +155,11 @@ func PrepDesiredRecords(dc *models.DomainConfig) {
|
||||
|
||||
recordsToKeep := make([]*models.RecordConfig, 0, len(dc.Records))
|
||||
for _, rec := range dc.Records {
|
||||
if rec.Type == "ALIAS" && rec.Name != "@" {
|
||||
// GANDI only permits aliases on a naked domain.
|
||||
// Therefore, we change this to a CNAME.
|
||||
rec.Type = "CNAME"
|
||||
}
|
||||
if rec.TTL < 300 {
|
||||
printer.Warnf("Gandi does not support ttls < 300. Setting %s from %d to 300\n", rec.GetLabelFQDN(), rec.TTL)
|
||||
rec.TTL = 300
|
||||
|
Reference in New Issue
Block a user