1 # This test only checks that basic network lookups work.
2 # The full test of toolchain version selection is in gotoolchain.txt.
4 env TESTGO_VERSION=go1.21actual
6 # GOTOOLCHAIN from network, does not exist
7 env GOTOOLCHAIN=go1.9999x
9 stderr 'go: download go1.9999x for .*: toolchain not available'
11 # GOTOOLCHAIN from network
12 [!exec:/bin/sh] stop 'the fake proxy serves shell scripts instead of binaries'
13 env GOTOOLCHAIN=go1.999testmod
15 stderr 'go: downloading go1.999testmod \(.*/.*\)'
17 # GOTOOLCHAIN cached from network
22 # GOTOOLCHAIN with GOSUMDB enabled but at a bad URL should operate in cache and not try badurl
24 env GOSUMDB=$oldsumdb' http://badurl'
29 # GOTOOLCHAIN with GOSUMB=off should fail, because it cannot access even the cached sumdb info
30 # without the sumdb name.
33 stderr '^go: golang.org/toolchain@v0.0.1-go1.999testmod.[a-z0-9\-]*: verifying module: checksum database disabled by GOSUMDB=off$'
35 # GOTOOLCHAIN with GOSUMDB enabled but at a bad URL should fail if cache is incomplete
36 env GOSUMDB=$oldsumdb' http://badurl'
37 rm $GOPATH/pkg/mod/cache/download/sumdb
40 stderr 'panic: use of network' # test catches network access
43 # Test a real GOTOOLCHAIN
45 [!net:golang.org] skip
46 [!GOOS:darwin] [!GOOS:windows] [!GOOS:linux] skip
47 [!GOARCH:amd64] [!GOARCH:arm64] skip
51 env GOTOOLCHAIN=go1.20.1
53 # Avoid resolving a "go1.20.1" from the user's real $PATH.
54 # That would not only cause the "downloading go1.20.1" message
55 # to be suppressed, but may spuriously fail:
56 # golang.org/dl/go1.20.1 expects to find its GOROOT in $HOME/sdk,
57 # but the script environment sets HOME=/no-home.
62 stderr '^go: downloading go1.20.1 '