Skip to content

[1.3] tests/rootless.sh: fix skipping idmap tests for systemd - #5228

Merged
lifubang merged 2 commits into
opencontainers:release-1.3from
kolyshkin:1.3-5226
Apr 9, 2026
Merged

lifubang merged 2 commits into
opencontainers:release-1.3from
kolyshkin:1.3-5226

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

Backport of #5226 to release-1.3.


When RUNC_USE_SYSTEMD is set, tests/rootless.sh is using

ssh -tt rootless@localhost

to run tests as rootless user. In this case, local environment is not passed to the user's ssh session (unless explicitly specified), and so the tests do not get ROOTLESS_FEATURES.

As a result we skip tests idmap-related tests when running as rootless using systemd cgroup driver, e.g.:

integration test (systemd driver)
...
[02] run rootless tests ... (idmap)
...
ok 286 runc run detached ({u,g}id != 0) # skip test requires rootless_idmap
...

Fix this.

Fixes: bf15cc9 ("cgroup v2: support rootless systemd")

Also, fix the typo (AUX_DIX) in cleanup.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit ac2a53b)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
When RUNC_USE_SYSTEMD is set, tests/rootless.sh is using

	ssh -tt rootless@localhost

to run tests as rootless user. In this case, local environment is not
passed to the user's ssh session (unless explicitly specified), and so
the tests do not get ROOTLESS_FEATURES.

As a result, idmap-related tests are skipped when running as rootless
using systemd cgroup driver:

	integration test (systemd driver)
	...
	[02] run rootless tests ... (idmap)
	...
	ok 286 runc run detached ({u,g}id != 0) # skip test requires rootless_idmap
	...

Fix this by creating a list of environment variables needed by the
tests, and adding those to ssh command line (in case of ssh) or
exporting (in case of sudo) so both cases work similarly.

Also, modify disable_idmap to unset variables set in enable_idmap so
they are not exported at all if idmap is not in features.

Fixes: bf15cc9 ("cgroup v2: support rootless systemd")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 3e0829d)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin added this to the 1.3.6 milestone Apr 8, 2026
@kolyshkin kolyshkin added area/ci backport/1.3-pr A backport PR to release-1.3 labels Apr 8, 2026

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lifubang
lifubang merged commit 760c2f9 into opencontainers:release-1.3 Apr 9, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci backport/1.3-pr A backport PR to release-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants