Skip to content

syscall: TestAmbientCaps and TestAmbientCapsUserns tests depend on the existence of a "nobody" user #71644

@vnmabus

Description

@vnmabus

Go version

go >= 1.9 (since 8aee0b8)

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/slapgrid/d48f33aba65193f6a61d39bdd1d67814/parts/golang1.21/.build/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/slapgrid/d48f33aba65193f6a61d39bdd1d67814/parts/golang1.21/.build/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.13'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3931421612=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I tried to run the tests as part of Golang compilation (to check that everything works) inside a Docker build.

What did you see happen?

The tests fail with the following error:

--- FAIL: TestAmbientCaps (0.00s)
    exec_linux_test.go:570: user: unknown user nobody
--- FAIL: TestAmbientCapsUserns (0.00s)
    exec_linux_test.go:570: user: unknown user nobody

This is because the tests expect a nobody user to exist, which is not true by default inside a Docker context.

What did you expect to see?

Ideally, I would expect the tests to pass without the need of having a nobody user.

As a second (worse) alternative, this requirement should be clearly documented, including the way to create a suitable nobody user if one does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.compiler/runtimeIssues related to the Go compiler and/or runtime.help wanted

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions