}
func TestLookupCNAME(t *testing.T) {
- if testing.Short() {
- // Don't use external network.
- t.Logf("skipping external network test during -short")
+ if testing.Short() || !*testExternal {
+ t.Logf("skipping test to avoid external network")
return
}
cname, err := LookupCNAME("www.google.com")
}
func TestDialGoogleIPv4(t *testing.T) {
- if testing.Short() {
- // Don't use external network.
- t.Logf("skipping external network test during -short")
+ if testing.Short() || !*testExternal {
+ t.Logf("skipping test to avoid external network")
return
}
}
func TestDialGoogleIPv6(t *testing.T) {
- if testing.Short() {
- // Don't use external network.
- t.Logf("skipping external network test during -short")
+ if testing.Short() || !*testExternal {
+ t.Logf("skipping test to avoid external network")
return
}
// Only run tcp6 if the kernel will take it.
"testing"
)
-var testExternal = flag.Bool("external", false, "allow use of external networks during test")
+var testExternal = flag.Bool("external", true, "allow use of external networks during long test")
func TestGoogleSRV(t *testing.T) {
if testing.Short() || !*testExternal {