]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: declare net hosts in script tests
authorBryan C. Mills <bcmills@google.com>
Fri, 3 Mar 2023 14:48:10 +0000 (14:48 +0000)
committerBryan Mills <bcmills@google.com>
Mon, 24 Apr 2023 15:54:04 +0000 (15:54 +0000)
Although we aren't precise about enforcing the hosts just yet,
we can eventually use the declared hostnames to selectively skip
tests (for example, if an external service has an outage while
a Go release is being tested).

Also relax the constraint to [short] in tests that require only
vcs-test.golang.org, which has redirected to an in-process server
since around CL 427914.

Also enforce that tests that use the network actually use the [net]
constraint, by setting TESTGONETWORK=panic in the test environment
until the condition is evaluated.

For #52545.
For #54503.
Updates #27494.

Change-Id: I13be6b42a9beee97657eb45424882e787ac164c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/473276
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Bypass: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>

73 files changed:
src/cmd/go/internal/web/http.go
src/cmd/go/script_test.go
src/cmd/go/scriptconds_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/get_404_meta.txt
src/cmd/go/testdata/script/get_custom_domain_wildcard.txt
src/cmd/go/testdata/script/get_dash_t.txt
src/cmd/go/testdata/script/get_domain_root.txt
src/cmd/go/testdata/script/get_dot_slash_download.txt
src/cmd/go/testdata/script/get_goroot.txt
src/cmd/go/testdata/script/get_insecure.txt
src/cmd/go/testdata/script/get_insecure_custom_domain.txt
src/cmd/go/testdata/script/get_insecure_env.txt
src/cmd/go/testdata/script/get_insecure_redirect.txt
src/cmd/go/testdata/script/get_insecure_update.txt
src/cmd/go/testdata/script/get_internal_wildcard.txt
src/cmd/go/testdata/script/get_issue11307.txt
src/cmd/go/testdata/script/get_issue16471.txt
src/cmd/go/testdata/script/get_issue22125.txt
src/cmd/go/testdata/script/get_non_pkg.txt
src/cmd/go/testdata/script/get_race.txt
src/cmd/go/testdata/script/get_test_only.txt
src/cmd/go/testdata/script/get_tilde.txt
src/cmd/go/testdata/script/get_update.txt
src/cmd/go/testdata/script/get_update_all.txt
src/cmd/go/testdata/script/get_update_unknown_protocol.txt
src/cmd/go/testdata/script/get_update_wildcard.txt
src/cmd/go/testdata/script/get_vendor.txt
src/cmd/go/testdata/script/get_with_git_trace.txt
src/cmd/go/testdata/script/gopath_moved_repo.txt
src/cmd/go/testdata/script/gopath_vendor_dup_err.txt
src/cmd/go/testdata/script/govcs.txt
src/cmd/go/testdata/script/install_shadow_gopath.txt
src/cmd/go/testdata/script/list_std_vendor.txt
src/cmd/go/testdata/script/mod_auth.txt
src/cmd/go/testdata/script/mod_convert.txt
src/cmd/go/testdata/script/mod_convert_tsv_insecure.txt
src/cmd/go/testdata/script/mod_download_git_decorate_full.txt
src/cmd/go/testdata/script/mod_download_hash.txt
src/cmd/go/testdata/script/mod_download_insecure_redirect.txt
src/cmd/go/testdata/script/mod_download_issue51114.txt
src/cmd/go/testdata/script/mod_download_private_vcs.txt
src/cmd/go/testdata/script/mod_download_svn.txt
src/cmd/go/testdata/script/mod_get_direct.txt
src/cmd/go/testdata/script/mod_get_fallback.txt
src/cmd/go/testdata/script/mod_get_fossil.txt
src/cmd/go/testdata/script/mod_get_hash.txt
src/cmd/go/testdata/script/mod_get_major.txt
src/cmd/go/testdata/script/mod_get_pseudo.txt
src/cmd/go/testdata/script/mod_get_pseudo_other_branch.txt
src/cmd/go/testdata/script/mod_get_pseudo_prefix.txt
src/cmd/go/testdata/script/mod_getx.txt
src/cmd/go/testdata/script/mod_git_export_subst.txt
src/cmd/go/testdata/script/mod_gonoproxy.txt
src/cmd/go/testdata/script/mod_gopkg_unstable.txt
src/cmd/go/testdata/script/mod_init_glide.txt
src/cmd/go/testdata/script/mod_invalid_version.txt
src/cmd/go/testdata/script/mod_list_direct.txt
src/cmd/go/testdata/script/mod_list_odd_tags.txt
src/cmd/go/testdata/script/mod_missing_repo.txt
src/cmd/go/testdata/script/mod_prefer_compatible.txt
src/cmd/go/testdata/script/mod_proxy_errors.txt
src/cmd/go/testdata/script/mod_proxy_https.txt
src/cmd/go/testdata/script/mod_pseudo_cache.txt
src/cmd/go/testdata/script/mod_replace_gopkgin.txt
src/cmd/go/testdata/script/mod_retract_pseudo_base.txt
src/cmd/go/testdata/script/mod_sumdb_file_path.txt
src/cmd/go/testdata/script/mod_sumdb_golang.txt
src/cmd/go/testdata/script/mod_vcs_missing.txt
src/cmd/go/testdata/script/reuse_git.txt
src/cmd/go/testdata/script/vendor_list_issue11977.txt
src/cmd/go/testdata/script/vendor_test_issue11864.txt
src/cmd/go/testdata/script/vendor_test_issue14613.txt

index cd3e39afe0a1abf38d6f17e3c8cea309b3b8c483..e7935ea18427708885aa4f95ed1f955fcd818d58 100644 (file)
@@ -114,7 +114,7 @@ func interceptURL(u *urlpkg.URL) (*Interceptor, bool) {
                return nil, false
        }
        for i, t := range testInterceptors {
-               if u.Host == t.FromHost && (t.Scheme == "" || u.Scheme == t.Scheme) {
+               if u.Host == t.FromHost && (u.Scheme == "" || u.Scheme == t.Scheme) {
                        return &testInterceptors[i], true
                }
        }
index 4211fb6121c674af33e60c0c7406609a5206ec7a..072a2dfef547fa9409172feb72c331f288ea1854 100644 (file)
@@ -210,6 +210,7 @@ func scriptEnv(srv *vcstest.Server, srvCertFile string) ([]string, error) {
                "GOROOT=" + testGOROOT,
                "GOROOT_FINAL=" + testGOROOT_FINAL, // causes spurious rebuilds and breaks the "stale" built-in if not propagated
                "GOTRACEBACK=system",
+               "TESTGONETWORK=panic", // allow only local connections by default; the [net] condition resets this
                "TESTGO_GOROOT=" + testGOROOT,
                "TESTGO_EXE=" + testGo,
                "TESTGO_VCSTEST_HOST=" + httpURL.Host,
@@ -232,8 +233,11 @@ func scriptEnv(srv *vcstest.Server, srvCertFile string) ([]string, error) {
                        "GIT_TRACE_CURL_NO_DATA=1",
                        "GIT_REDACT_COOKIES=o,SSO,GSSO_Uberproxy")
        }
-       if !testenv.HasExternalNetwork() {
-               env = append(env, "TESTGONETWORK=panic", "TESTGOVCS=panic")
+       if testing.Short() {
+               // VCS commands are always somewhat slow: they either require access to external hosts,
+               // or they require our intercepted vcs-test.golang.org to regenerate the repository.
+               // Require all tests that use VCS commands to be skipped in short mode.
+               env = append(env, "TESTGOVCS=panic")
        }
        if os.Getenv("CGO_ENABLED") != "" || runtime.GOOS != goHostOS || runtime.GOARCH != goHostArch {
                // If the actual CGO_ENABLED might not match the cmd/go default, set it
index c57d55a3d172132d8f1448e85a3f7e50d9d15442..a9b5f9acec404b3e08de413ad43917ff6e9277bb 100644 (file)
@@ -40,6 +40,7 @@ func scriptConditions() map[string]script.Cond {
        add("buildmode", script.PrefixCondition("go supports -buildmode=<suffix>", hasBuildmode))
        add("case-sensitive", script.OnceCondition("$WORK filesystem is case-sensitive", isCaseSensitive))
        add("cgo", script.BoolCondition("host CGO_ENABLED", testenv.HasCGO()))
+       add("cgolinkext", script.BoolCondition("platform requires external linking for cgo", platform.MustLinkExternal(cfg.Goos, cfg.Goarch, true)))
        add("cross", script.BoolCondition("cmd/go GOOS/GOARCH != GOHOSTOS/GOHOSTARCH", goHostOS != runtime.GOOS || goHostArch != runtime.GOARCH))
        add("fuzz", sysCondition("-fuzz", platform.FuzzSupported, false))
        add("fuzz-instrumented", sysCondition("-fuzz with instrumentation", platform.FuzzInstrumented, false))
@@ -49,8 +50,7 @@ func scriptConditions() map[string]script.Cond {
        add("link", lazyBool("testenv.HasLink()", testenv.HasLink))
        add("mismatched-goroot", script.Condition("test's GOROOT_FINAL does not match the real GOROOT", isMismatchedGoroot))
        add("msan", sysCondition("-msan", platform.MSanSupported, true))
-       add("cgolinkext", script.BoolCondition("platform requires external linking for cgo", platform.MustLinkExternal(cfg.Goos, cfg.Goarch, true)))
-       add("net", lazyBool("testenv.HasExternalNetwork()", testenv.HasExternalNetwork))
+       add("net", script.PrefixCondition("can connect to external network host <suffix>", hasNet))
        add("race", sysCondition("-race", platform.RaceDetectorSupported, true))
        add("symlink", lazyBool("testenv.HasSymlink()", testenv.HasSymlink))
        add("trimpath", script.OnceCondition("test binary was built with -trimpath", isTrimpath))
@@ -95,6 +95,20 @@ func hasBuildmode(s *script.State, mode string) (bool, error) {
        return platform.BuildModeSupported(runtime.Compiler, mode, GOOS, GOARCH), nil
 }
 
+func hasNet(s *script.State, host string) (bool, error) {
+       if !testenv.HasExternalNetwork() {
+               return false, nil
+       }
+
+       // TODO(bcmills): Add a flag or environment variable to allow skipping tests
+       // for specific hosts and/or skipping all net tests except for specific hosts.
+
+       // Since we have confirmed that the network is available,
+       // allow cmd/go to use it.
+       s.Setenv("TESTGONETWORK", "")
+       return true, nil
+}
+
 func hasGodebug(s *script.State, value string) (bool, error) {
        godebug, _ := s.LookupEnv("GODEBUG")
        for _, p := range strings.Split(godebug, ",") {
index 349ba972fb692d6464eb2057475819404841a4cf..c653764145efe5a4630bbaca70c7dc4708918f73 100644 (file)
@@ -402,8 +402,8 @@ The available conditions are:
        test's GOROOT_FINAL does not match the real GOROOT
 [msan]
        GOOS/GOARCH supports -msan
-[net]
-       testenv.HasExternalNetwork()
+[net:*]
+       can connect to external network host <suffix>
 [race]
        GOOS/GOARCH supports -race
 [root]
index 553afb9ae105c3960356391c733d0c6eff49c951..4ffbdebd8608c5345ba5818d86df8e330f795f39 100644 (file)
@@ -1,6 +1,6 @@
 # golang.org/issue/13037: 'go get' was not parsing <meta> tags in 404 served over HTTPS.
 
-[!net] skip
+[!net:bazil.org] skip
 [!git] skip
 
 env GONOSUMDB=bazil.org,github.com,golang.org
index 32ddd92b59882d16e5d0792c4050bdee19cd282a..45ab5243c2b3618ad18c026266889b237d81ac86 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:rsc.io] skip
 [!git] skip
 env GO111MODULE=off
 
index 66d217a869fa00c8f2fcc20394842726e0ebce2a..8f3a03646b557a9e13b40d03713122d4c81fcd21 100644 (file)
@@ -1,6 +1,6 @@
 # Tests issue 8181
 
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 250fa6464f518ff0059c4769ca1b3a6f37d977aa..dfcea865b9f58266d7ea0715773a6615251666f7 100644 (file)
@@ -1,7 +1,7 @@
 # Tests issue #9357
 # go get foo.io (not foo.io/subdir) was not working consistently.
 
-[!net] skip
+[!net:go-get-issue-9357.appspot.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 2af9564fe42e30c4d1f1d921df43c7b0f5fc6009..6dbd1184cc733edb33e546bae96fbd191a4bd578 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:rsc.io] skip
 [!git] skip
 env GO111MODULE=off
 
index dc1e5adccf1f9825a0e25e9dc0cc7b08a6675835..751069221f399e9a8b73ea6eeb8b73fcd7a03268 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 env GO111MODULE=off
 
 # Issue 4186. go get cannot be used to download packages to $GOROOT.
index 0079220e40816fe1c15384f96696e6c3be08e152..afe64b8c2667fe6d86132d416da2c2002baade2e 100644 (file)
@@ -1,6 +1,6 @@
 # TODO(matloob): Split this test into two? It's one of the slowest tests we have.
 
-[!net] skip
+[!net:insecure.go-get-issue-15410.appspot.com] skip
 [!git] skip
 
 env PATH=$WORK/tmp/bin${:}$PATH
index 3a0765f2a1ed6f596342869661055909b453b46d..4b3c9d66eae2bd7ae46da201102ebe82dc9c387a 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:insecure.go-get-issue-15410.appspot.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 87484404eb67a4495b370faa6480f3a7238d96b1..98e705384ae02b2c234527e0c666cbb7dd035e87 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:insecure.go-get-issue-15410.appspot.com] skip
 [!git] skip
 
 # GOPATH: Set up
index 2e5ec4e0d8c6da8b87e80fe5e50449547e8c56fb..2a37902215bf361f4232503d4c45c83324a77356 100644 (file)
@@ -1,7 +1,6 @@
 # golang.org/issue/29591: 'go get' was following plain-HTTP redirects even without -insecure (now replaced by GOINSECURE).
 # golang.org/issue/34049: 'go get' would panic in case of an insecure redirect in GOPATH mode
 
-[!net] skip
 [!git] skip
 
 env GO111MODULE=off
index 01660d58b4b1753292a211f2673c03b87c19ac7b..7cddd6ba8e64a5d7138805a16be8ccd3ff4237c1 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 71ecb8c8fe16028237c0e49dc684b951ea1e6193..b25e746ba60a7335868fa4f8cf0e3c82aa54cc69 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index dc46e747123b35c3e394bcc5803f4b1a72dfe15a..d490959438c0d846d012b1235b0cbeda040b4e05 100644 (file)
@@ -1,6 +1,6 @@
 # go get -u was not working except in checkout directory
 
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 60369132f95a6baa34dfe0b3a16db9ca8a4c70a9..1aeae584a9d7d316102caa6719d899e76abb36c5 100644 (file)
@@ -1,4 +1,5 @@
-[!net] skip
+[!net:rsc.io] skip
+[!net:github.com] skip
 [!git] skip
 
 env GO111MODULE=off
index 3418df8429576c21d5d34f37100c815c39979717..086081f60d6c13b279f0181fcbaebf688bb9e3d4 100644 (file)
@@ -1,6 +1,6 @@
 # This test verifies a fix for a security issue; see https://go.dev/issue/22125.
 
-[!net] skip
+[short] skip
 [!git] skip
 [!exec:svn] skip
 
index 5eac1e337ee6d7f703e93c8a437313e1e156f257..5202e88a254dc251dbe5d66fadb01c09fcc6c37c 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 
 env GOBIN=$WORK/tmp/gobin
@@ -11,4 +11,4 @@ stderr 'golang.org/x/tools: no Go files'
 stderr 'golang.org/x/tools: no Go files'
 
 ! go get -d golang.org/x/tools
-stderr 'golang.org/x/tools: no Go files'
\ No newline at end of file
+stderr 'golang.org/x/tools: no Go files'
index 87fbf62863b037ba28e224a3e4e27dd6b6992ec3..1e06c80805b3f7174d78ac82f5bb421d5aff735e 100644 (file)
@@ -1,6 +1,6 @@
 # Tests issue #20502
 
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 [!race] skip
 env GO111MODULE=off
index ec8baf9553f9ab06f6fc47b56e2c71d0ce20a42d..af90f74b6fba0006a0b2d657726d0664f827e844 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 env GO111MODULE=off
 
index e520957359ca124caf8c5f6327a9e2133ed6c5ad..1c3a02965e7d706000f75362c592ed7ce9d0b614 100644 (file)
@@ -1,24 +1,25 @@
 env GO111MODULE=off
-[short] skip
 
 # Paths containing windows short names should be rejected before attempting to fetch.
-! go get example.com/longna~1.dir/thing
+! go get vcs-test.golang.org/longna~1.dir/thing
 stderr 'trailing tilde and digits'
-! go get example.com/longna~1/thing
+! go get vcs-test.golang.org/longna~1/thing
 stderr 'trailing tilde and digits'
-! go get example.com/~9999999/thing
+! go get vcs-test.golang.org/~9999999/thing
 stderr 'trailing tilde and digits'
 
+[short] stop
+
 # A path containing an element that is just a tilde, or a tilde followed by non-digits,
 # should attempt to resolve.
-! go get example.com/~glenda/notfound
+! go get vcs-test.golang.org/~glenda/notfound
 ! stderr 'trailing tilde and digits'
 stderr 'unrecognized import path'
 
-! go get example.com/~glenda2/notfound
+! go get vcs-test.golang.org/~glenda2/notfound
 ! stderr 'trailing tilde and digits'
 stderr 'unrecognized import path'
 
-! go get example.com/~/notfound
+! go get vcs-test.golang.org/~/notfound
 ! stderr 'trailing tilde and digits'
 stderr 'unrecognized import path'
index 5aeb99000b203a6d9839e6439018fb9678a02e98..a70a80d2d6baba3d40975344becd0a6d7e1363c8 100644 (file)
@@ -2,7 +2,7 @@
 # The recursive updating was trying to walk to
 # former dependencies, not current ones.
 
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 2b7584920956eedf242646e45269e3f28693c84d..22fe3edaf1edbd77ad56ed0b4334ec38ddd01de2 100644 (file)
@@ -1,8 +1,6 @@
 # Issue 14444: go get -u .../ duplicate loads errors
 # Check that go get update -u ... does not try to load duplicates
 
-[!net] skip
-
 env GO111MODULE=off
 
 go get -u -n .../
index 12807ad675f7d1b048370899e4c250d8bdad202e..714ed6a9ca0319bb8b01235373bbc2fbd270720d 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 01e2c374aefea0fda74d4be87c9a39b068cecdb4..c83378311439fe56672e62da7232d7d59a00aa32 100644 (file)
@@ -1,6 +1,6 @@
 # Issue 14450: go get -u .../ tried to import not downloaded package
 
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index f9a4a6bf7bff1c7cc52099422d2552642ebd95a6..179456d9f38ed0b70027bed10a7140e0c10f88a9 100644 (file)
@@ -11,7 +11,7 @@ stdout 'v/vendor/vendor.org/p'
 go get -d
 go get -t -d
 
-[!net] stop
+[!net:github.com] stop
 [!git] stop
 
 cd $GOPATH/src
index abc7014e45749d079a7db177772e35e7dc1fac67..6f1305a83baf2b53f7a2e4e55ad9b0e488a3ccaa 100644 (file)
@@ -2,7 +2,7 @@ env GO111MODULE=off
 
 env GIT_TRACE=1
 
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 
 # go get should be success when GIT_TRACE set
index 5815d73a4aeafe0873a739fb8fa559a6144c9e69..8108d9bb6de1ebbde1f8b59bd044325815a27e15 100644 (file)
@@ -3,7 +3,7 @@ env GO111MODULE=off
 # Test that 'go get -u' reports packages whose VCS configurations do not
 # match their import paths.
 
-[!net] skip
+[!net:rsc.io] skip
 [short] skip
 
 # We need to execute a custom Go program to break the config files.
index 22e6048e96b95eff11e1c0bd1d3eca54d0f1036f..5f1e09a88b90eabd799841ec0a64f1cea039cb6d 100644 (file)
@@ -1,4 +1,3 @@
-[!net] skip
 env GO111MODULE=off
 
 # Issue 17119: Test more duplicate load errors.
index 419a6c5d20dd44c9aa751db60801730cbf1ae24c..dd128cca2f85c3a7971b7470233ff4ea7acb9186 100644 (file)
@@ -67,12 +67,12 @@ stderr '^go: rsc.io/nonexist.bzr/hello: GOVCS disallows using bzr for public rsc
 # git is OK by default
 env GOVCS=
 env GONOSUMDB='*'
-[net] [git] [!short] go get rsc.io/sampler
+[net:rsc.io] [git] [!short] go get rsc.io/sampler
 
 # hg is OK by default
 env GOVCS=
 env GONOSUMDB='*'
-[net] [exec:hg] [!short] go get vcs-test.golang.org/go/custom-hg-hello
+[exec:hg] [!short] go get vcs-test.golang.org/go/custom-hg-hello
 
 # git can be disallowed
 env GOVCS=public:hg
@@ -150,12 +150,12 @@ stderr '^package rsc.io/nonexist.bzr/hello: GOVCS disallows using bzr for public
 # git is OK by default
 env GOVCS=
 env GONOSUMDB='*'
-[net] [git] [!short] go get rsc.io/sampler
+[net:rsc.io] [git] [!short] go get rsc.io/sampler
 
 # hg is OK by default
 env GOVCS=
 env GONOSUMDB='*'
-[net] [exec:hg] [!short] go get vcs-test.golang.org/go/custom-hg-hello
+[exec:hg] [!short] go get vcs-test.golang.org/go/custom-hg-hello
 
 # git can be disallowed
 env GOVCS=public:hg
index 2039d9e7f2ece442866c9936e01ccfcda59c7a58..148e6cc6147042d7c2334bf8046c89d6700b816e 100644 (file)
@@ -1,8 +1,6 @@
 # Tests Issue #3562
 # go get foo.io (not foo.io/subdir) was not working consistently.
 
-[!net] skip
-
 env GO111MODULE=off
 env GOPATH=$WORK/gopath1${:}$WORK/gopath2
 
index 923e95799daf4b83289d5f75fe94e2c1625b45ad..834babe674d9d97ca9f8b49658c35ae64365d3c0 100644 (file)
@@ -25,7 +25,7 @@ cmp stdout $WORK/net-deps.txt
 # However, 'go mod' and 'go get' subcommands should report the original module
 # dependencies, not the vendored packages.
 
-[!net] stop
+[!net:golang.org] stop
 
 env GOPROXY=
 env GOWORK=off
index d8ea5867d6b65999bcc63879811db46faf8b5d5d..5e2b7a918fa6df17147728d4b02ff11215a15554 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[short] skip
 
 env GO111MODULE=on
 env GOPROXY=direct
index 1c9d626acdfe8ec41a8df710f7be87295ae8855b..922d9246c3d8867d5386cf26e03ff52d8e5e8043 100644 (file)
@@ -1,5 +1,6 @@
-[short] skip
-[!net] skip
+[!net:github.com] skip
+[!net:golang.org] skip
+[!net:gopkg.in] skip
 [!git] skip
 
 env GO111MODULE=on
@@ -13,6 +14,9 @@ cd x
 go mod init github.com/docker/distribution
 cmpenv go.mod go.mod.want
 
+[!net:google.golang.org] skip
+[!net:cloud.google.com] skip
+
 go mod download github.com/fishy/gcsbucket@v0.0.0-20180217031846-618d60fe84e0
 cp $GOPATH/pkg/mod/github.com/fishy/gcsbucket@v0.0.0-20180217031846-618d60fe84e0/Gopkg.lock ../y
 cd ../y
index 9910ce769936d3edf010a6cd3055b9bb8c06aa1d..6ff69933e8acf2f799752e40f26cdc8ad3cd5243 100644 (file)
@@ -2,7 +2,7 @@ env GO111MODULE=on
 env GOPROXY=direct
 env GOSUMDB=off
 
-[!net] skip
+[short] skip
 [!git] skip
 
 # secure fetch should report insecure warning
index 997b502b247b9bc38176fd5ad3ad22573f8e977b..080ccf072e02715c38e5cef665f17894a046ecd5 100644 (file)
@@ -1,6 +1,6 @@
 env GO111MODULE=on
 
-[!net] skip
+[short] skip
 [!git] skip
 
 env GOPROXY=direct
@@ -25,4 +25,4 @@ stdout 'vcs-test.golang.org/git/gitrepo1.git v1.2.3'
 
 -- $WORK/home/gopher/.gitconfig --
 [log]
-       decorate = full
\ No newline at end of file
+       decorate = full
index e62a165e75908b48b1a3cfbeaff6b24af8563ac7..5677e69a5d53494038a2a071aae493796d2849c0 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=on
 
 # Testing mod download with non semantic versions; turn off proxy.
-[!net] skip
+[!net:rsc.io] skip
 [!git] skip
 env GOPROXY=direct
 env GOSUMDB=off
index fed5b8da4bf1ad943178349b39c5f83169a16b39..20a6ac2aa03ad660ef261e87a55aafe4eacac142 100644 (file)
@@ -1,6 +1,6 @@
 # golang.org/issue/29591: 'go get' was following plain-HTTP redirects even without -insecure (now replaced by GOINSECURE).
 
-[!net] skip
+[short] skip
 [!git] skip
 
 env GO111MODULE=on
index 68cce8ca262b5072d4b89d698cf5da6a763c6d2f..4d274d61a97c04dd38ac3db297aecf89c5e6a4d8 100644 (file)
@@ -1,6 +1,5 @@
-[short] skip
+[!net:github.com] skip
 [!git] skip
-[!net] skip
 [!GOOS:linux] skip  # Uses XDG_CONFIG_HOME
 
 env GIT_CONFIG_GLOBAL=$WORK/.gitconfig
index 7459b80a6cf7db9078fe3040cda3b5b1a343cfa0..2f72a4213a3c3bc6cb5442247ee4de7d0ff3afb8 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=on
 
 # Testing stderr for git ls-remote; turn off proxy.
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GOPROXY=direct
 
index 79e00dc9706c9fd80ba7f7a37eec2e076678817b..c11b4f978149767e0c75b86701fc3fbca7facdf4 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[short] skip
 [!exec:svn] skip
 
 # 'go mod download' will fall back to svn+ssh once svn fails over protocols like https.
index b7b052984c3ff51ca4d06e09aadc1cf1ec0f2943..02b10ab6fd2a78f4291014fac5f6af25f7eba1e0 100644 (file)
@@ -2,8 +2,7 @@
 # 'GOPROXY=direct go get golang.org/x/tools/gopls@master' did not correctly
 # resolve the pseudo-version for its dependency on golang.org/x/tools.
 
-[short] skip
-[!net] skip
+[!net:cloud.google.com] skip
 [!git] skip
 
 env GO111MODULE=on
index 35722333d6a0e86b195f80ff13f1fa73c56fa3d1..a5119b6efe2d2f1c86f10578d77c015ded14207d 100644 (file)
@@ -1,6 +1,7 @@
 env GO111MODULE=on
 
-[!net] skip
+[!net:golang.org] skip
+[!net:proxy.golang.org] skip
 
 env GOPROXY=https://proxy.golang.org,direct
 env GOSUMDB=off
index c2d42f0f596f4a01b0077a54aa515b9fba1f4f68..830e0de7aa2ad5b772dfefd6dad14eb66eea6298 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[short] skip
 [!exec:fossil] skip
 
 # Regression test for 'go get' to ensure repositories
index 63e9e46db1ca60403f7f32e36b96b98d4383c2fe..ec5549defe08c7855720413a4bb9e79871df48ae 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=on
 env GOPROXY=direct
 env GOSUMDB=off
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 
 # fetch commit hash reachable from refs/heads/* and refs/tags/* is OK
index 76c9de5cc7e12fce7657b2da9ebb729374504f45..4e0febbca26e252c0f18c99ded531b2739cb23bd 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[short] skip
 [!git] skip
 
 env GO111MODULE=on
index 7b43c69c1d4a612582c0d87cd2ac2ab05c275fd4..47ad54e352c1703bc2dcc00e1acf43b4effa2064 100644 (file)
@@ -1,7 +1,7 @@
 env GO111MODULE=on
 
 # Testing git->module converter's generation of +incompatible tags; turn off proxy.
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GOPROXY=direct
 env GOSUMDB=off
index 21f900f303dd9169bab9c8cce51a4fd2ddf77e41..6019b45a2c8be4260d9c5d9d82f001918c4c3a30 100644 (file)
@@ -6,7 +6,7 @@ env GOSUMDB=off
 # tag that appears in any commit that is a (transitive) parent of the commit
 # supplied to 'go get', regardless of branches
 
-[!net] skip
+[short] skip
 [!git] skip
 
 # For this test repository:
index 513450d4a5af3b1f850584d19403854976e683be..ac3233e040656b12de49ce3e33c3f259c7cd5f6d 100644 (file)
@@ -6,7 +6,7 @@ env GOSUMDB=off
 # prefixed tag in any commit that is a parent of the commit supplied
 # to 'go get', when using a repo with go.mod in a sub directory.
 
-[!net] skip
+[short] skip
 [!git] skip
 
 # For this test repository go.mod resides in sub/ (only):
index dee3f747c6c38bd5449699f9d5cd08f2e68162ce..46bb95bf58fb3a75abfb5ca52263c68d627e1ff3 100644 (file)
@@ -1,5 +1,4 @@
-[short] skip
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 
 env GO111MODULE=on
index 44fb501fa85515dac55e9610f7ea9266adfda4e0..740ccbdb81e780dae8b6b30ec761e4a335dcdaaf 100644 (file)
@@ -2,7 +2,7 @@ env GO111MODULE=on
 env GOPROXY=direct
 
 # Testing that git export-subst is disabled
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 go build
 
index 98a1d28b5620631a24fb9d0bd215a286ffeae15e..94d03f22f266b27fd7b73c954cfbb1e944acd3c4 100644 (file)
@@ -36,13 +36,14 @@ env GOPROXY=off
 stderr '^go: golang.org/x/text: module lookup disabled by GOPROXY=off$'
 
 # GONOPROXY bypasses proxy
-[!net] skip
+[!net:rsc.io] skip
 [!git] skip
 env GOPRIVATE=none
 env GONOPROXY='*/fortune'
 ! go get rsc.io/fortune # does not exist in real world, only on test proxy
 stderr 'git ls-remote'
 
+[!net:golang.org] skip
 env GOSUMDB=
 env GONOPROXY=
 env GOPRIVATE='*/x'
index 3608bcd79607da3ca28ff2178f8454e700851cce..856f493f30ce9104b6c91995af19995184bdbac7 100644 (file)
@@ -7,7 +7,7 @@ cp x.go.txt x.go
 cp go.mod.empty go.mod
 go list
 
-[!net] skip
+[!net:gopkg.in] skip
 [!git] skip
 
 skip  # TODO(#54503): redirect gopkg.in requests to a local server and re-enable.
index 2126ae5b48768b5181728ee868a9805c706d3f0d..0d087eb607a8323d4afebe90c085027e8ae35e03 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 
 env GO111MODULE=on
index d1e1da4492512b98cff5631288f099fb42a69f84..c841f27a214ff73d1af9c909552681cc0956f0d9 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 
 env GO111MODULE=on
@@ -178,6 +178,8 @@ cd ..
 ! go list -m golang.org/x/text
 stderr 'golang.org/x/text@v0.1.1-0.20170915032832-14c0d48ead0c\+incompatible: invalid version: \+incompatible suffix not allowed: major version v0 is compatible'
 
+[!net:github.com] stop
+
 # The pseudo-version for a commit after a tag with a non-matching major version
 # should instead be based on the last matching tag.
 cp go.mod.orig go.mod
index 3e7c479d664952d7274353416a9f35ee8d972548..8bab330ac82c913a9c5f612f722652e611dadb59 100644 (file)
@@ -2,7 +2,7 @@ env GO111MODULE=on
 env GOPROXY=direct
 env GOSUMDB=off
 
-[!net] skip
+[short] skip
 [!git] skip
 
 # golang.org/issue/33099: if an import path ends in a major-version suffix,
index b413e87e18ac51d796d2323761352647cde3e6d5..232754eacaba5f845836927159169b1ef80141e7 100644 (file)
@@ -1,6 +1,5 @@
 [short] skip
 [!git] skip
-[!net] skip
 
 env GOPROXY=direct
 
index 4b403fe51e1dce836096a871748351f60dc2731b..d0076f7b3bdfdcda93dc5f66080b2f7f77e2f7af 100644 (file)
@@ -2,7 +2,7 @@
 # subgroups could not be fetched because the server returned bogus go-import
 # tags for prefixes of the module path.
 
-[!net] skip
+[short] skip
 [!git] skip
 
 env GO111MODULE=on
index 7ba5eb4fa9cb0b125f04e231c7ddd751cbdbd77e..57036b95be8bc438eecf8f3395832e8edb4f2315 100644 (file)
@@ -2,7 +2,8 @@
 # @latest, @upgrade, and @patch should prefer compatible versions over
 # +incompatible ones, even if offered by a proxy.
 
-[!net] skip
+[!net:github.com] skip
+[!net:proxy.golang.org] skip
 
 env GO111MODULE=on
 env GOPROXY=
index 9cd1a824f0848e05e0597d104dbad18f6a98072c..99a4ef1c5dd988f3866c0cfb1731d639f35671f4 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[short] skip
 
 env GO111MODULE=on
 env GOSUMDB=off
index a5e28dd0b9771b04b68c7d3dc5b82fdca9934960..c87a0d9450616f93be03246b7499be7e4d58ee6e 100644 (file)
@@ -5,7 +5,7 @@ env GOPROXY=$WORK/proxydir
 ! go list -versions -m golang.org/x/text
 stderr 'invalid proxy URL.*proxydir'
 
-[!net] stop
+[!net:proxy.golang.org] stop
 
 # GOPROXY HTTPS paths may elide the "https://" prefix.
 # (See golang.org/issue/32191.)
index a7ceac42b4262f96dfa10e825383a137064b0cb6..bcaefa2f79f5c7f3a64aeec7c2e822dac7a68b09 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:golang.org] skip
 [!git] skip
 
 env GO111MODULE=on
index 04b79dd55d5a95cd71037a1b71eca0ec3caef63a..91008f920f31b44dad165c237dd586415db21f43 100644 (file)
@@ -7,8 +7,7 @@
 skip 'skipping test that depends on an unreliable third-party server; see https://go.dev/issue/54503'
        # TODO(#54043): Make this test hermetic and re-enable it.
 
-[short] skip
-[!net] skip
+[!net:gopkg.in] skip
 [!git] skip
 
 env GO111MODULE=on
index c52f0b851e15d24810e64d0b2ba034b1a31c9159..87b440dc7ea793d601cf76ea47eef967ec1633ba 100644 (file)
@@ -2,7 +2,7 @@
 # as the base.
 # Verifies golang.org/issue/41700.
 
-[!net] skip
+[short] skip
 [!git] skip
 env GOPROXY=direct
 env GOSUMDB=off
index d89ad1aa338c752faf239bada5a4d31092c814e4..c95a667bfdcada19af78e958e1569ddb1ec189fa 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:proxy.golang.org] skip
 
 env GO111MODULE=on
 env GOSUMDB=
index 7dd6cdc06676515d60fbd42b9b2aa0cc81c7b00b..8698412f786ad6fbf26e03130235510f33ad3840 100644 (file)
@@ -11,7 +11,8 @@ stdout '^sum.golang.org$'
 
 # Download direct from github.
 
-[!net] skip
+[!net:proxy.golang.org] skip
+[!net:sum.golang.org] skip
 [!git] skip
 env GOSUMDB=sum.golang.org
 env GOPROXY=direct
index 9e6e371927bef9f83cd31d9247928201c200dcf2..7f63e9de217f53b6fd11b2b89cf7bdd056ee1392 100644 (file)
@@ -1,5 +1,5 @@
 [exec:bzr] skip 'tests NOT having bzr'
-[!net] skip
+[!net:launchpad.net] skip
 
 env GO111MODULE=on
 env GOPROXY=direct
index 4f9e0dd17fdb2aad222a52797edd28e86b31b3fd..0357d670f4324d371fdf222dd17342dbdc74667c 100644 (file)
@@ -1,6 +1,5 @@
 [short] skip
 [!git] skip
-[!net] skip
 
 env GO111MODULE=on
 env GOPROXY=direct
index 35c82c7b2109280ad13edebdcdb0397dc261fb3d..f519175d8aee10a5bb96bc32e6bddf72fb88fcc0 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index ff179cbe8b2d4503004633ca510b43e63c362e49..9e34811bb4a72b5a5b099d5f0d4a640ebf469c0a 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off
 
index 7822deeeda91589e230d723f6a9b34407b54c41f..9535fc13e953947c5298571955334cece3b53579 100644 (file)
@@ -1,4 +1,4 @@
-[!net] skip
+[!net:github.com] skip
 [!git] skip
 env GO111MODULE=off