diff options
Diffstat (limited to 'src/syscall/syscall_linux_test.go')
| -rw-r--r-- | src/syscall/syscall_linux_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/syscall/syscall_linux_test.go b/src/syscall/syscall_linux_test.go index ff128b1a19..1300fc046e 100644 --- a/src/syscall/syscall_linux_test.go +++ b/src/syscall/syscall_linux_test.go @@ -6,6 +6,7 @@ package syscall_test import ( "fmt" + "internal/testenv" "io" "io/fs" "os" @@ -198,6 +199,13 @@ func TestSyscallNoError(t *testing.T) { if os.Getuid() != 0 { t.Skip("skipping root only test") } + if testing.Short() && testenv.Builder() != "" && os.Getenv("USER") == "swarming" { + // The Go build system's swarming user is known not to be root. + // Unfortunately, it sometimes appears as root due the current + // implementation of a no-network check using 'unshare -n -r'. + // Since this test does need root to work, we need to skip it. + t.Skip("skipping root only test on a non-root builder") + } if runtime.GOOS == "android" { t.Skip("skipping on rooted android, see issue 27364") @@ -516,6 +524,13 @@ func TestSetuidEtc(t *testing.T) { if syscall.Getuid() != 0 { t.Skip("skipping root only test") } + if testing.Short() && testenv.Builder() != "" && os.Getenv("USER") == "swarming" { + // The Go build system's swarming user is known not to be root. + // Unfortunately, it sometimes appears as root due the current + // implementation of a no-network check using 'unshare -n -r'. + // Since this test does need root to work, we need to skip it. + t.Skip("skipping root only test on a non-root builder") + } if _, err := os.Stat("/etc/alpine-release"); err == nil { t.Skip("skipping glibc test on alpine - go.dev/issue/19938") } |
