aboutsummaryrefslogtreecommitdiff
path: root/src/net/dnsclient_unix_test.go
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2016-04-14 12:17:44 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2016-04-14 06:13:45 +0000
commited7cd2546eb997e976534f0542816e12448f34d5 (patch)
tree4e71dd10002269b88ff5e2e29ee754c914c7314b /src/net/dnsclient_unix_test.go
parent8f64336edc7c725abcbe564d21b3d2dc5ec250ec (diff)
downloadgo-ed7cd2546eb997e976534f0542816e12448f34d5.tar.gz
go-ed7cd2546eb997e976534f0542816e12448f34d5.zip
net: make use of internal/testenv package
Change-Id: I6644081df495cb92b3d208f867066f9acb08946f Reviewed-on: https://go-review.googlesource.com/22074 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/dnsclient_unix_test.go')
-rw-r--r--src/net/dnsclient_unix_test.go21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/net/dnsclient_unix_test.go b/src/net/dnsclient_unix_test.go
index 6845481e17d..edf7c00f72d 100644
--- a/src/net/dnsclient_unix_test.go
+++ b/src/net/dnsclient_unix_test.go
@@ -8,6 +8,7 @@ package net
import (
"fmt"
+ "internal/testenv"
"io/ioutil"
"os"
"path"
@@ -32,9 +33,7 @@ var dnsTransportFallbackTests = []struct {
}
func TestDNSTransportFallback(t *testing.T) {
- if testing.Short() || !*testExternal {
- t.Skip("avoid external network")
- }
+ testenv.MustHaveExternalNetwork(t)
for _, tt := range dnsTransportFallbackTests {
timeout := time.Duration(tt.timeout) * time.Second
@@ -74,9 +73,7 @@ var specialDomainNameTests = []struct {
}
func TestSpecialDomainName(t *testing.T) {
- if testing.Short() || !*testExternal {
- t.Skip("avoid external network")
- }
+ testenv.MustHaveExternalNetwork(t)
server := "8.8.8.8:53"
for _, tt := range specialDomainNameTests {
@@ -232,9 +229,7 @@ var updateResolvConfTests = []struct {
}
func TestUpdateResolvConf(t *testing.T) {
- if testing.Short() || !*testExternal {
- t.Skip("avoid external network")
- }
+ testenv.MustHaveExternalNetwork(t)
conf, err := newResolvConfTest()
if err != nil {
@@ -389,9 +384,7 @@ var goLookupIPWithResolverConfigTests = []struct {
}
func TestGoLookupIPWithResolverConfig(t *testing.T) {
- if testing.Short() || !*testExternal {
- t.Skip("avoid external network")
- }
+ testenv.MustHaveExternalNetwork(t)
conf, err := newResolvConfTest()
if err != nil {
@@ -436,9 +429,7 @@ func TestGoLookupIPWithResolverConfig(t *testing.T) {
// Test that goLookupIPOrder falls back to the host file when no DNS servers are available.
func TestGoLookupIPOrderFallbackToFile(t *testing.T) {
- if testing.Short() || !*testExternal {
- t.Skip("avoid external network")
- }
+ testenv.MustHaveExternalNetwork(t)
// Add a config that simulates no dns servers being available.
conf, err := newResolvConfTest()