mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os, syscall: skip tests when environment doesn't permit testing
Fixes #14693 Change-Id: Id0a6a80b4c37c0b0f1c2755667b7233ed8964e40 Reviewed-on: https://go-review.googlesource.com/20342 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
2b19b6e3f1
commit
40e60e7c13
2 changed files with 11 additions and 4 deletions
|
|
@ -31,6 +31,9 @@ func whoamiCmd(t *testing.T, uid, gid int, setgroups bool) *exec.Cmd {
|
|||
if os.IsNotExist(err) {
|
||||
t.Skip("kernel doesn't support user namespaces")
|
||||
}
|
||||
if os.IsPermission(err) {
|
||||
t.Skip("unable to test user namespaces due to permissions")
|
||||
}
|
||||
t.Fatalf("Failed to stat /proc/self/ns/user: %v", err)
|
||||
}
|
||||
if isChrooted(t) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue