author | Alberto Bertogli
<albertito@blitiri.com.ar> 2020-07-24 17:47:37 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2020-07-24 18:16:06 UTC |
parent | 67a432adc6658d28cb0009da0c394c3355ca63ea |
yml_test.go | +20 | -8 |
diff --git a/yml_test.go b/yml_test.go index b3b9ca8..3443e46 100644 --- a/yml_test.go +++ b/yml_test.go @@ -43,14 +43,15 @@ type Test struct { // Only one of these will be set. type Record struct { - A stringSlice `yaml:"A"` - AAAA stringSlice `yaml:"AAAA"` - MX *MX `yaml:"MX"` - SPF stringSlice `yaml:"SPF"` - TXT stringSlice `yaml:"TXT"` - PTR stringSlice `yaml:"PTR"` - CNAME stringSlice `yaml:"CNAME"` - TIMEOUT bool `yaml:"TIMEOUT"` + A stringSlice `yaml:"A"` + AAAA stringSlice `yaml:"AAAA"` + MX *MX `yaml:"MX"` + SPF stringSlice `yaml:"SPF"` + TXT stringSlice `yaml:"TXT"` + PTR stringSlice `yaml:"PTR"` + CNAME stringSlice `yaml:"CNAME"` + TIMEOUT bool `yaml:"TIMEOUT"` + SERVFAIL bool `yaml:"SERVFAIL"` } func (r Record) String() string { @@ -78,6 +79,9 @@ func (r Record) String() string { if r.TIMEOUT { return "TIMEOUT" } + if r.SERVFAIL { + return "SERVFAIL" + } return fmt.Sprintf("<empty>") } @@ -164,6 +168,14 @@ func testRFC(t *testing.T, fname string) { } dns.errors[domain] = err } + if record.SERVFAIL { + err := &net.DNSError{ + Err: "test servfail error", + IsTimeout: false, + IsTemporary: false, + } + dns.errors[domain] = err + } for _, s := range record.A { dns.ip[domain] = append(dns.ip[domain], net.ParseIP(s)) }