Skip to content

Commit b16e94d

Browse files
pmurgopherbot
authored andcommitted
syscall: skip TestUseCgroupFD if cgroupfs mounted RO
The skipping logic should also trigger if /sys/fs/cgroup is mounted read-only too. This is how it is mounted on the ppc64le/p10 containers today. Fixes #57262 Change-Id: Idc0ab050052ebf5777ac09f9519215b437b0ee7c Reviewed-on: https://go-review.googlesource.com/c/go/+/456835 Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Run-TryBot: Paul Murphy <[email protected]>
1 parent 27301e8 commit b16e94d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/syscall/exec_linux_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package syscall_test
88

99
import (
1010
"bytes"
11+
"errors"
1112
"flag"
1213
"fmt"
1314
"internal/testenv"
@@ -504,7 +505,8 @@ func prepareCgroupFD(t *testing.T) (int, string) {
504505
// Need an ability to create a sub-cgroup.
505506
subCgroup, err := os.MkdirTemp(prefix+string(bytes.TrimSpace(cg)), "subcg-")
506507
if err != nil {
507-
if os.IsPermission(err) {
508+
// Running in an unprivileged container, this may also return EROFS #57262.
509+
if os.IsPermission(err) || errors.Is(err, syscall.EROFS) {
508510
t.Skip(err)
509511
}
510512
t.Fatal(err)

0 commit comments

Comments
 (0)