]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: skip testAmbientCaps tests if there is no nobody user
authorCarlos Ramos CarreƱo <vnmabus@gmail.com>
Fri, 14 Feb 2025 10:14:29 +0000 (10:14 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 14 Feb 2025 22:00:03 +0000 (14:00 -0800)
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: a4c4f5bb61929b4981dc0b92d773bd4ef13d7d3d
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>
src/syscall/exec_linux_test.go

index 1c2024af4550bfe7034fc3d5477eb2266ad16b19..04973dc9ad306b63b5bf7df00ba9588b8a335713 100644 (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 {