Update linux-x86 Go prebuilts from ab/9878432
https://ci.android.com/builds/branches/aosp-build-tools-release/grid?head=9878432&tail=9878432
Update script: toolchain/go/update-prebuilts.sh
Test: Treehugger presubmit
Change-Id: I07818c960e04b2ef4373ab22161590b088582d39
diff --git a/src/net/dnsconfig_unix_test.go b/src/net/dnsconfig_unix_test.go
index 513f624..0aae2ba 100644
--- a/src/net/dnsconfig_unix_test.go
+++ b/src/net/dnsconfig_unix_test.go
@@ -53,6 +53,16 @@
},
},
{
+ name: "testdata/search-single-dot-resolv.conf",
+ want: &dnsConfig{
+ servers: []string{"8.8.8.8:53"},
+ search: []string{},
+ ndots: 1,
+ timeout: 5 * time.Second,
+ attempts: 2,
+ },
+ },
+ {
name: "testdata/empty-resolv.conf",
want: &dnsConfig{
servers: defaultNS,
@@ -166,13 +176,17 @@
getHostname = func() (string, error) { return "host.domain.local", nil }
for _, tt := range dnsReadConfigTests {
+ want := *tt.want
+ if len(want.search) == 0 {
+ want.search = dnsDefaultSearch()
+ }
conf := dnsReadConfig(tt.name)
if conf.err != nil {
t.Fatal(conf.err)
}
conf.mtime = time.Time{}
- if !reflect.DeepEqual(conf, tt.want) {
- t.Errorf("%s:\ngot: %+v\nwant: %+v", tt.name, conf, tt.want)
+ if !reflect.DeepEqual(conf, &want) {
+ t.Errorf("%s:\ngot: %+v\nwant: %+v", tt.name, conf, want)
}
}
}
@@ -259,8 +273,13 @@
t.Fatal(conf.err)
}
+ suffixList := tt.want.search
+ if len(suffixList) == 0 {
+ suffixList = dnsDefaultSearch()
+ }
+
var shortestSuffix int
- for _, suffix := range tt.want.search {
+ for _, suffix := range suffixList {
if shortestSuffix == 0 || len(suffix) < shortestSuffix {
shortestSuffix = len(suffix)
}