aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_sumdb_file_path.txt
blob: 575c7c48173793102b07a13a98c98cf599ecec3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[!net] skip

env GO111MODULE=on
env GOSUMDB=
env GOPATH=$WORK/gopath1

# With a file-based proxy with an empty checksum directory,
# downloading a new module should fail, even if a subsequent
# proxy contains a more complete mirror of the sum database.
#
# TODO(bcmills): The error message here is a bit redundant.
# It comes from the sumweb package, which isn't yet producing structured errors.
[windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
[!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
! go get -d golang.org/x/text@v0.3.2
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.*)'

# If the proxy does not claim to support the database,
# checksum verification should fall through to the next proxy,
# and downloading should succeed.
[windows] env GOPROXY=file:///$WORK/emptyproxy,https://proxy.golang.org
[!windows] env GOPROXY=file://$WORK/emptyproxy,https://proxy.golang.org
go get -d golang.org/x/text@v0.3.2

# After a successful sumdb lookup, the lookup can be repeated
# using the download cache as a proxy.
cp supported $GOPATH/pkg/mod/cache/download/sumdb/sum.golang.org/supported
[windows] env GOPROXY=file:///$WORK/gopath1/pkg/mod/cache/download,file:///$WORK/sumproxy
[!windows] env GOPROXY=file://$WORK/gopath1/pkg/mod/cache/download,file://$WORK/sumproxy
env GOPATH=$WORK/gopath2
rm go.sum
go get -d -x -v golang.org/x/text@v0.3.2

# Once the checksum is present in the go.sum file,
# an empty file-based sumdb can be used in conjunction with
# a fallback module mirror.
grep golang.org/x/text go.sum
env GOPATH=$WORK/gopath3
[windows] env GOPROXY=file:///$WORK/sumproxy
[!windows] env GOPROXY=file://$WORK/sumproxy
! go get -d golang.org/x/text@v0.3.2
[windows] env GOPROXY=file:///$WORK/sumproxy,https://proxy.golang.org
[!windows] env GOPROXY=file://$WORK/sumproxy,https://proxy.golang.org
go get -d golang.org/x/text@v0.3.2

-- supported --

-- go.mod --
module example.com
go 1.13
-- $WORK/emptyproxy/README.md --
This proxy contains no modules.
-- $WORK/sumproxy/README.md --
This proxy contains no modules.
-- $WORK/sumproxy/sumdb/sum.golang.org/supported --
This proxy blocks checksum downloads from sum.golang.org.