From 6bdca82030779e3b9032324e68a3feacb85bc9bc Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 19 Aug 2022 17:38:00 -0400 Subject: [PATCH] misc/cgo/test: disable setgid tests with musl We don't have a good musl detection mechanism, so we detect Alpine (the most common user of musl) instead. For #39857. For #19938. Change-Id: I2fa39248682aed75884476374fe2212be4427347 Reviewed-on: https://go-review.googlesource.com/c/go/+/425001 Reviewed-by: Cherry Mui Run-TryBot: Michael Pratt Reviewed-by: Ian Lance Taylor Auto-Submit: Michael Pratt TryBot-Result: Gopher Robot --- misc/cgo/test/cgo_linux_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/cgo/test/cgo_linux_test.go b/misc/cgo/test/cgo_linux_test.go index 7c4628c493..f7c07582a4 100644 --- a/misc/cgo/test/cgo_linux_test.go +++ b/misc/cgo/test/cgo_linux_test.go @@ -5,6 +5,7 @@ package cgotest import ( + "os" "runtime" "testing" ) @@ -13,6 +14,9 @@ func TestSetgid(t *testing.T) { if runtime.GOOS == "android" { t.Skip("unsupported on Android") } + if _, err := os.Stat("/etc/alpine-release"); err == nil { + t.Skip("setgid is broken with musl libc - go.dev/issue/39857") + } testSetgid(t) } @@ -20,6 +24,9 @@ func TestSetgidStress(t *testing.T) { if runtime.GOOS == "android" { t.Skip("unsupported on Android") } + if _, err := os.Stat("/etc/alpine-release"); err == nil { + t.Skip("setgid is broken with musl libc - go.dev/issue/39857") + } testSetgidStress(t) } -- 2.44.0