Skip to content

Commit

Permalink
misc/cgo/test: disable setgid tests with musl
Browse files Browse the repository at this point in the history
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 <[email protected]>
Run-TryBot: Michael Pratt <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Michael Pratt <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
prattmic authored and gopherbot committed Aug 22, 2022
1 parent 761db3e commit 6bdca82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions misc/cgo/test/cgo_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package cgotest

import (
"os"
"runtime"
"testing"
)
Expand All @@ -13,13 +14,19 @@ 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)
}

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)
}

Expand Down

0 comments on commit 6bdca82

Please sign in to comment.