]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc/cgo/test: disable setgid tests with musl
authorMichael Pratt <mpratt@google.com>
Fri, 19 Aug 2022 21:38:00 +0000 (17:38 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 22 Aug 2022 14:48:53 +0000 (14:48 +0000)
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 <cherryyz@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

misc/cgo/test/cgo_linux_test.go

index 7c4628c49330c004cb93d597c42c11d3eb27fbcf..f7c07582a4d432958d5e15618d7598bc54913039 100644 (file)
@@ -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)
 }