}
func skipInContainer(t *testing.T) {
+ // TODO: the callers of this func are using this func to skip
+ // tests when running as some sort of "fake root" that's uid 0
+ // but lacks certain Linux capabilities. Most of the Go builds
+ // run in privileged containers, though, where root is much
+ // closer (if not identical) to the real root. We should test
+ // for what we need exactly (which capabilities are active?),
+ // instead of just assuming "docker == bad". Then we'd get more test
+ // coverage on a bunch of builders too.
if isDocker() {
t.Skip("skip this test in Docker container")
}
t.Skip("kernel prohibits unshare in unprivileged process, unless using user namespace")
}
- // When running under the Go continuous build, skip tests for
- // now when under Kubernetes. (where things are root but not quite)
- // Both of these are our own environment variables.
- // See Issue 12815.
- if os.Getenv("GO_BUILDER_NAME") != "" && os.Getenv("IN_KUBERNETES") == "1" {
- t.Skip("skipping test on Kubernetes-based builders; see Issue 12815")
- }
-
d, err := ioutil.TempDir("", "unshare")
if err != nil {
t.Fatalf("tempdir: %v", err)
t.Skip("kernel prohibits unshare in unprivileged process, unless using user namespace")
}
- // When running under the Go continuous build, skip tests for
- // now when under Kubernetes. (where things are root but not quite)
- // Both of these are our own environment variables.
- // See Issue 12815.
- if os.Getenv("GO_BUILDER_NAME") != "" && os.Getenv("IN_KUBERNETES") == "1" {
- t.Skip("skipping test on Kubernetes-based builders; see Issue 12815")
- }
-
d, err := ioutil.TempDir("", "unshare")
if err != nil {
t.Fatalf("tempdir: %v", err)
skipInContainer(t)
mustSupportAmbientCaps(t)
- // When running under the Go continuous build, skip tests for
- // now when under Kubernetes. (where things are root but not quite)
- // Both of these are our own environment variables.
- // See Issue 12815.
- if os.Getenv("GO_BUILDER_NAME") != "" && os.Getenv("IN_KUBERNETES") == "1" {
- t.Skip("skipping test on Kubernetes-based builders; see Issue 12815")
- }
-
skipUnprivilegedUserClone(t)
// skip on android, due to lack of lookup support