1
0
mirror of https://github.com/golang/go synced 2024-11-14 13:40:30 -07:00

syscall: skip TestSetuidEtc when root's gid is not 0

Fixes #69921
This commit is contained in:
Shuo Wang 2024-10-18 10:33:55 +08:00
parent 70f4717e96
commit 5724383eb1

View File

@ -499,6 +499,9 @@ func TestSetuidEtc(t *testing.T) {
if syscall.Getuid() != 0 { if syscall.Getuid() != 0 {
t.Skip("skipping root only test") t.Skip("skipping root only test")
} }
if syscall.Getgid() != 0 {
t.Skip("skipping the test when root's gid is not default value 0")
}
if testing.Short() && testenv.Builder() != "" && os.Getenv("USER") == "swarming" { if testing.Short() && testenv.Builder() != "" && os.Getenv("USER") == "swarming" {
// The Go build system's swarming user is known not to be root. // The Go build system's swarming user is known not to be root.
// Unfortunately, it sometimes appears as root due the current // Unfortunately, it sometimes appears as root due the current