Commit b7376442 authored by Mikio Hara's avatar Mikio Hara

net: change cname lookup test target to iana.org

It might be meaningful, and stable than others.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6499091
parent ef48dfa3
......@@ -41,17 +41,6 @@ func doDial(t *testing.T, network, addr string) {
fd.Close()
}
func TestLookupCNAME(t *testing.T) {
if testing.Short() || !*testExternal {
t.Logf("skipping test to avoid external network")
return
}
cname, err := LookupCNAME("www.google.com")
if !strings.HasSuffix(cname, ".l.google.com.") || err != nil {
t.Errorf(`LookupCNAME("www.google.com.") = %q, %v, want "*.l.google.com.", nil`, cname, err)
}
}
var googleaddrsipv4 = []string{
"%d.%d.%d.%d:80",
"www.google.com:80",
......
......@@ -9,6 +9,7 @@ package net
import (
"flag"
"strings"
"testing"
)
......@@ -79,6 +80,17 @@ func TestGoogleDNSAddr(t *testing.T) {
}
}
func TestLookupIANACNAME(t *testing.T) {
if testing.Short() || !*testExternal {
t.Logf("skipping test to avoid external network")
return
}
cname, err := LookupCNAME("www.iana.org")
if !strings.HasSuffix(cname, ".icann.org.") || err != nil {
t.Errorf(`LookupCNAME("www.iana.org.") = %q, %v, want "*.icann.org.", nil`, cname, err)
}
}
var revAddrTests = []struct {
Addr string
Reverse string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment