1
0
mirror of https://github.com/golang/go synced 2024-09-30 06:24:33 -06:00
go/misc/cgo/test/cgo_linux_test.go
Michael Pratt 6bdca82030 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 <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>
2022-08-22 14:48:53 +00:00

36 lines
867 B
Go

// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
import (
"os"
"runtime"
"testing"
)
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)
}
func Test1435(t *testing.T) { test1435(t) }
func Test6997(t *testing.T) { test6997(t) }
func TestBuildID(t *testing.T) { testBuildID(t) }