Commit 2ba9f7c2 authored by Jay Conrod's avatar Jay Conrod

cmd/go: fix sumdb test failure with misbehaving DNS server

Broadened the regular expression used to test error messages for
failing to connect to "localhost.localdev/sumdb". Some DNS servers
resolve unknown domains like "localhost.localdev" to real IP addresses
to serve ads. We may get a variety of error messages.

Fixes #31779

Change-Id: Ib389c633c9a9f70f8e89bbcba5282a375da4e708
Reviewed-on: https://go-review.googlesource.com/c/go/+/182799
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent cb0f0d6c
......@@ -17,11 +17,14 @@ rm $GOPATH/pkg/mod/download/cache/sumdb
rm go.sum
# direct access fails (because localhost.localdev does not exist)
# The text of the error message is hard to predict because some DNS servers
# will resolve unknown domains like localhost.localdev to a real IP
# to serve ads.
cp go.mod.orig go.mod
env GOSUMDB=$sumdb
env GOPROXY=direct
! go get -d rsc.io/fortune@v1.0.0
stderr 'verifying.*lookup.*localhost.localdev'
stderr 'verifying.*localhost.localdev'
rm $GOPATH/pkg/mod/download/cache/sumdb
rm go.sum
......@@ -30,7 +33,7 @@ cp go.mod.orig go.mod
env GOSUMDB=$sumdb
env GOPROXY=$proxy/sumdb-404
! go get -d rsc.io/fortune@v1.0.0
stderr 'verifying.*lookup.*localhost.localdev'
stderr 'verifying.*localhost.localdev'
rm $GOPATH/pkg/mod/download/cache/sumdb
rm go.sum
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment