Text file src/cmd/go/testdata/script/mod_sumdb_file_path.txt

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

View as plain text