syscall: skip testAmbientCaps tests if there is no nobody user

When there is not a nobody user (for example inside Docker), the
tests TestAmbientCaps and TestAmbientCapsUserns should be skipped
instead of failing.

Fixes #71644

Change-Id: I7f92db19e2b6f449d8d897650a0ecd89f5150f4a
GitHub-Last-Rev: a4c4f5bb61
GitHub-Pull-Request: golang/go#71729
Reviewed-on: https://go-review.googlesource.com/c/go/+/649396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Carlos Ramos Carreño 2025-02-14 10:14:29 +00:00 committed by Gopher Robot
parent 8c05e020d5
commit 1959703ddd
1 changed files with 1 additions and 1 deletions

View File

@ -646,7 +646,7 @@ func testAmbientCaps(t *testing.T, userns bool) {
u, err := user.Lookup("nobody")
if err != nil {
t.Fatal(err)
t.Skip("skipping: the nobody user does not exist; see Issue 71644")
}
uid, err := strconv.ParseInt(u.Uid, 0, 32)
if err != nil {