]> git.feebdaed.xyz Git - 0xmirror/crun.git/commit
tests: add cgroup manager env var support
authorGiuseppe Scrivano <gscrivan@redhat.com>
Wed, 17 Dec 2025 09:42:57 +0000 (09:42 +0000)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Mon, 22 Dec 2025 07:10:55 +0000 (08:10 +0100)
commitba669d8e32279efc7e27cb226d40d9d31214ea53
treeb389c0f440347b58b7601e0f7b87f244aabef8f0
parent06541b6997ce7d732bb539769d89f46da5bdd5ac
tests: add cgroup manager env var support

Add get_cgroup_manager() that reads the CGROUP_MANAGER environment
variable, defaulting to 'cgroupfs'. This allows running the entire
test suite with a different cgroup manager without modifying tests.

Also add get_test_environment() helper that returns a dict describing
the current test environment (uid, rootless, systemd, cgroup_v2, etc.)
for debugging purposes.

The run_and_get_output() function now uses the env var when the
cgroup_manager parameter is not explicitly specified, allowing tests
to inherit the environment setting while still supporting explicit
overrides.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
tests/tests_utils.py