1 [!net] skip
2
3 env GO111MODULE=on
4 env GOSUMDB=
5 env GOPATH=$WORK/gopath1
6
7 # With a file-based proxy with an empty checksum directory,
8 # downloading a new module should fail, even if a subsequent
9 # proxy contains a more complete mirror of the sum database.
10 #
11 # TODO(bcmills): The error message here is a bit redundant.
12 # It comes from the sumweb package, which isn't yet producing structured errors.
13 [windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
14 [!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
15 ! go get golang.org/x/text@v0.3.2
16 stderr '^go: golang.org/x/text@v0.3.2: verifying module: golang.org/x/text@v0.3.2: reading file://.*/sumdb/sum.golang.org/lookup/golang.org/x/text@v0.3.2: (no such file or directory|.*cannot find the path specified.*)'
17
18 # If the proxy does not claim to support the database,
19 # checksum verification should fall through to the next proxy,
20 # and downloading should succeed.
21 [windows] env GOPROXY=file:///$WORK/emptyproxy,https://proxy.golang.org
22 [!windows] env GOPROXY=file://$WORK/emptyproxy,https://proxy.golang.org
23 go get golang.org/x/text@v0.3.2
24
25 # After a successful sumdb lookup, the lookup can be repeated
26 # using the download cache as a proxy.
27 cp supported $GOPATH/pkg/mod/cache/download/sumdb/sum.golang.org/supported
28 [windows] env GOPROXY=file:///$WORK/gopath1/pkg/mod/cache/download,file:///$WORK/sumproxy
29 [!windows] env GOPROXY=file://$WORK/gopath1/pkg/mod/cache/download,file://$WORK/sumproxy
30 env GOPATH=$WORK/gopath2
31 rm go.sum
32 go get -x -v golang.org/x/text@v0.3.2
33
34 # Once the checksum is present in the go.sum file,
35 # an empty file-based sumdb can be used in conjunction with
36 # a fallback module mirror.
37 grep golang.org/x/text go.sum
38 env GOPATH=$WORK/gopath3
39 [windows] env GOPROXY=file:///$WORK/sumproxy
40 [!windows] env GOPROXY=file://$WORK/sumproxy
41 ! go get golang.org/x/text@v0.3.2
42 [windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
43 [!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
44 go get golang.org/x/text@v0.3.2
45
46 -- supported --
47
48 -- go.mod --
49 module example.com
50 go 1.13
51 -- $WORK/emptyproxy/README.md --
52 This proxy contains no modules.
53 -- $WORK/sumproxy/README.md --
54 This proxy contains no modules.
55 -- $WORK/sumproxy/sumdb/sum.golang.org/supported --
56 This proxy blocks checksum downloads from sum.golang.org.
57
View as plain text