summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/miekg/dns/xfr_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/miekg/dns/xfr_test.go')
-rw-r--r--vendor/github.com/miekg/dns/xfr_test.go27
1 files changed, 25 insertions, 2 deletions
diff --git a/vendor/github.com/miekg/dns/xfr_test.go b/vendor/github.com/miekg/dns/xfr_test.go
index 1337eec65..a478963a3 100644
--- a/vendor/github.com/miekg/dns/xfr_test.go
+++ b/vendor/github.com/miekg/dns/xfr_test.go
@@ -4,6 +4,7 @@ package dns
import (
"net"
+ "strings"
"testing"
"time"
)
@@ -16,8 +17,7 @@ func getIP(s string) string {
return a[0]
}
-// flaky, need to setup local server and test from
-// that.
+// flaky, need to setup local server and test from that.
func TestAXFR_Miek(t *testing.T) {
// This test runs against a server maintained by Miek
if testing.Short() {
@@ -159,3 +159,26 @@ func testAXFRSIDN(t *testing.T, host, alg string) {
}
}
}
+
+func TestAXFRFailNotAuth(t *testing.T) {
+ // This tests run against a server maintained by SIDN labs, see:
+ // https://workbench.sidnlabs.nl/
+ if testing.Short() {
+ return
+ }
+ x := new(Transfer)
+
+ m := new(Msg)
+ m.SetAxfr("sidnlabs.nl.")
+ c, err := x.In(m, "yadifa.sidnlabs.nl:53")
+ if err != nil {
+ t.Fatal(err)
+ }
+ for e := range c {
+ if e.Error != nil {
+ if !strings.HasPrefix(e.Error.Error(), "dns: bad xfr rcode:") {
+ t.Fatal(e.Error)
+ }
+ }
+ }
+}