Skip to content

Tests that require not-rootless are getting skipped with target=docker (where the cli is not run as root) #3453

Open
@apostasie

Description

@apostasie

Description

rootlessutil.IsRootless will (appropriately) return true if we are not root - but then, the docker daemon may run rootful, and at least some of these tests should definitely run for docker as well.

While the CI is running with -exec sudo - running locally without sudo will skip tests and give the developer the false impression it is fine.

eg:

go test -v  ./cmd/nerdctl/container/ -run TestRunWithOOMScoreAdj -test.target docker
go test -v  -exec sudo ./cmd/nerdctl/container/ -run TestRunWithOOMScoreAdj -test.target docker

Should likely yield the same results.

Pretty sure there are side-effects to consider here, as not being root will prevent us from writing certain files on the host for example, so, we should not change that on the legacy tooling - but we should account for that in the tooling rewrite.

Steps to reproduce the issue

na

Describe the results you received and expected

na

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cie.g., CI failurebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions