aboutsummaryrefslogtreecommitdiff
path: root/src/net/conf_test.go
diff options
context:
space:
mode:
authorKatie Hockman <katie@golang.org>2020-12-14 10:03:05 -0500
committerKatie Hockman <katie@golang.org>2020-12-14 10:06:13 -0500
commit0345ede87ee12698988973884cfc0fd3d499dffd (patch)
tree7123cff141ee5661208d2f5f437b8f5252ac7f6a /src/net/conf_test.go
parent4651d6b267818b0e0d128a5443289717c4bb8cbc (diff)
parent0a02371b0576964e81c3b40d328db9a3ef3b031b (diff)
downloadgo-0345ede87ee12698988973884cfc0fd3d499dffd.tar.xz
[dev.fuzz] all: merge master into dev.fuzz
Change-Id: I5d8c8329ccc9d747bd81ade6b1cb7cb8ae2e94b2
Diffstat (limited to 'src/net/conf_test.go')
-rw-r--r--src/net/conf_test.go21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/net/conf_test.go b/src/net/conf_test.go
index 3c7403eccc..1fe3cf41b1 100644
--- a/src/net/conf_test.go
+++ b/src/net/conf_test.go
@@ -7,7 +7,7 @@
package net
import (
- "os"
+ "io/fs"
"strings"
"testing"
)
@@ -26,7 +26,7 @@ var defaultResolvConf = &dnsConfig{
ndots: 1,
timeout: 5,
attempts: 2,
- err: os.ErrNotExist,
+ err: fs.ErrNotExist,
}
func TestConfHostLookupOrder(t *testing.T) {
@@ -106,7 +106,7 @@ func TestConfHostLookupOrder(t *testing.T) {
name: "solaris_no_nsswitch",
c: &conf{
goos: "solaris",
- nss: &nssConf{err: os.ErrNotExist},
+ nss: &nssConf{err: fs.ErrNotExist},
resolv: defaultResolvConf,
},
hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupCgo}},
@@ -170,16 +170,23 @@ func TestConfHostLookupOrder(t *testing.T) {
},
hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNSFiles}},
},
- // glibc lacking an nsswitch.conf, per
- // https://www.gnu.org/software/libc/manual/html_node/Notes-on-NSS-Configuration-File.html
{
name: "linux_no_nsswitch.conf",
c: &conf{
goos: "linux",
- nss: &nssConf{err: os.ErrNotExist},
+ nss: &nssConf{err: fs.ErrNotExist},
resolv: defaultResolvConf,
},
- hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNSFiles}},
+ hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
+ },
+ {
+ name: "linux_empty_nsswitch.conf",
+ c: &conf{
+ goos: "linux",
+ nss: nssStr(""),
+ resolv: defaultResolvConf,
+ },
+ hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
},
{
name: "files_mdns_dns",