Skip to content

Commit 1194098

Browse files
committed
net: add unit test for empty nsswitch on linux
Add testcase for ane existing but empty /etc/nsswitch.conf on linux. Signed-off-by: Natanael Copa <[email protected]>
1 parent c735e47 commit 1194098

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/net/conf_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,15 @@ func TestConfHostLookupOrder(t *testing.T) {
179179
},
180180
hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
181181
},
182+
{
183+
name: "linux_empty_nsswitch.conf",
184+
c: &conf{
185+
goos: "linux",
186+
nss: nssStr(""),
187+
resolv: defaultResolvConf,
188+
},
189+
hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
190+
},
182191
{
183192
name: "files_mdns_dns",
184193
c: &conf{

0 commit comments

Comments
 (0)