You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add integration tests for cgroup v2 and systemd #3605
Is it open to claim? The v2 integration tests are exactly the gap the runc-compat suite keeps tripping over: resources.unified, swap, blkio weight and hugetlb are all skipped there today.
My plan, following the reference you pointed at:
Port the coverage of runc's cgroups.bats into the contest harness as v2 tests, one controller per module (memory, pids, cpu, cpuset, io/blkio, hugetlb, devices), using the same file layout the existing v1-relative PRs used (tests/cgroups/<name>.rs + mod.rs wiring).
Each test runs the same OCI spec under a reference runc and under youki, asserting the v2 cgroupfs state from inside the container (the runtimetest binary pattern), so divergences surface per-controller rather than as one monolithic check.
Controllers in order: memory, pids, cpu, cpuset first (highest usage); blkio/io, hugetlb, devices after. Happy to reorder if some are already considered done.
One question before I start: is contest the right home for these, or would you rather see them in the integration crate? The closed v1 PRs used contest, so that's my default.
Will send the first controller as a draft PR so the shape gets reviewed early.
This test is open to claim, and contest is the right place to add the tests.
@ARMeeru@tommady
It would be helpful if you could let us know in advance which parts you plan to work on, so we can coordinate and avoid duplicate work.
This test is open to claim, and contest is the right place to add the tests.
@ARMeeru@tommady It would be helpful if you could let us know in advance which parts you plan to work on, so we can coordinate and avoid duplicate work.
Planning to cover these in order: memory, pids, cpu, cpuset first, then blkio/io, hugetlb, and devices.
All tests will go in contest under tests/contest/contest/src/tests/cgroups/v2/, following the existing layout. Each test runs the same spec under a reference runc and under youki, asserting the v2 cgroupfs state from inside the container.
Will start with memory and check in here before moving to the next controller so that I know what tommady picked up.
Two questions before I add more, so I don't build in a direction you don't want.
File layout: should the v2 memory tests go in a standalone memory_v2.rs next to the existing memory.rs, or would you rather I move the memory tests into a cgroups/memory/ module with v1.rs and v2.rs to mirror cgroups/cpu/? I have the standalone file in the PR now; the module move is a pure rename if you prefer it.
Scope: the PR covers the three mappings (limit to memory.max, reservation to memory.low, and the swap - limit conversion into memory.swap.max). Should the two rejection paths (a swap value without a limit, and a swap value below the limit) be part of this PR, or a separate one? I left them out to keep this one small.
Personally, I'd like to eventually remove the v1 tests and have only v2 and systemd tests, so I think a directory structure like the following would be ideal:
One coordination point from my side: the memory tests in #3725 are unaffected by the v1 removal except for the cgroup_v1_memory registration in main.rs, which sits next to the lines #3727 deletes, so I expect a small rebase conflict there.
Once #3727 merges, I'll rebase onto it and rename my file to memory.rs, matching the flat per-controller layout you described. I'll hold off until then so I'm not building on an unmerged branch.
One question: your layout from the 11th lists hugetlb.rs flat under tests/cgroups/. Move the three tests there as part of the migration, or keep the tlb/ directory and only switch the checks? I would move them, but either works.
@saku3 status since the last check-in, for the coordination this thread set up:
Merged: memory (#3725), pids (#3741), hugetlb (#3752), cpuset (#3779) and unified (#3806) from me, and io from aayush0325 (#3731). cpu already had v2 coverage, and systemd/ arrived with #3721. The io work also covered the per-device BFQ weight test from runc's suite.
Of the layout sketched on Sep 11, the one piece left without a test group is the cgroupfs devices controller. @t-akashi your rust_oci_test branch carries a cgroup v2 devices group (6e982da); now that #3721 turned the feature on by default, do you plan to send it? Happy to leave it with you. If you would rather pass it on, I'll pick the work up and rework it against what #3721 added.
The one runc cgroups.bats test with no coverage left is per-device multiple iops through unified; I'll take that next. With devices in and that landed, every test in the reference suite has a home here.
@t-akashi your rust_oci_test branch carries a cgroup v2 devices group (6e982da); now that #3721 turned the feature on by default, do you plan to send it? Happy to leave it with you.
Thank you for heads-up.
I'll try to rework my patch onto the latest (0.7.1).
Give me some time.
27. > @t-akashi your rust_oci_test branch carries a cgroup v2 devices group (6e982da); now that #3721 turned the feature on by default, do you plan to send it? Happy to leave it with you.
Thank you for heads-up.
I'll try to rework my patch onto the latest (0.7.1).
Give me some time.
After looking at my commit (6e982da), I concluded that we don't need this test case.
Basically it tests one scenario which, I think, is already covered by a few of your tests
(that is, test_whitelist_rules and test_redundant_deny_preserves_devices_access).
It also have two variants, an absolute path and a relative path for the "CgroupsPath", but it doesn't make sense as
youki supports only a particular format of "[slice]:[prefix]:[name] (crates/libcgroups/src/systemd/manager.rs).
The controller groups from the proposed layout are now present, except for a dedicated cgroupfs devices.rs. The per-device multiple-IOPS unified test is enabled and passes.
For the device scope, test_whitelist_rules and test_redundant_deny_preserves_device_access pass --systemd-cgroup, so they cover the systemd driver only. The enabled runc device tests exercise cgroupfs instead. Is that runc coverage sufficient for this issue, or would you prefer a dedicated contest devices group?
Two related runc tests are red in the nightly:
update cgroup v2 resources via unified map gets cpu.weight 17 where the pinned runc test expects 4. Current youki uses the newer quadratic shares-to-weight mapping, while the pinned runc helper uses the linear mapping. This needs test-baseline triage.
update devices [minimal transition rules] fails during create because the device BPF parser rejects the a in the test's rwa access rule.
I suggest tracking those separately from this umbrella so this one stays about test coverage. Once we settle the device-scope question and have the failures tracked, would you be comfortable closing it?
Activity
ARMeeru commentedon Sep 10, 2026
Is it open to claim? The v2 integration tests are exactly the gap the runc-compat suite keeps tripping over:
resources.unified, swap, blkio weight and hugetlb are all skipped there today.My plan, following the reference you pointed at:
cgroups.batsinto the contest harness as v2 tests, one controller per module (memory,pids,cpu,cpuset,io/blkio,hugetlb,devices), using the same file layout the existing v1-relative PRs used (tests/cgroups/<name>.rs+mod.rswiring).runtimetestbinary pattern), so divergences surface per-controller rather than as one monolithic check.One question before I start: is contest the right home for these, or would you rather see them in the integration crate? The closed v1 PRs used contest, so that's my default.
Will send the first controller as a draft PR so the shape gets reviewed early.
saku3 commentedon Sep 11, 2026
@ARMeeru
Thank you.
This test is open to claim, and
contestis the right place to add the tests.@ARMeeru @tommady
It would be helpful if you could let us know in advance which parts you plan to work on, so we can coordinate and avoid duplicate work.
ARMeeru commentedon Sep 11, 2026
Planning to cover these in order: memory, pids, cpu, cpuset first, then blkio/io, hugetlb, and devices.
All tests will go in
contestundertests/contest/contest/src/tests/cgroups/v2/, following the existing layout. Each test runs the same spec under a reference runc and under youki, asserting the v2 cgroupfs state from inside the container.Will start with memory and check in here before moving to the next controller so that I know what tommady picked up.
test(contest): add cgroup v2 memory integration tests
test(contest): add cgroup v2 memory integration tests
ARMeeru commentedon Sep 11, 2026
Two questions before I add more, so I don't build in a direction you don't want.
File layout: should the v2 memory tests go in a standalone
memory_v2.rsnext to the existingmemory.rs, or would you rather I move the memory tests into acgroups/memory/module withv1.rsandv2.rsto mirrorcgroups/cpu/? I have the standalone file in the PR now; the module move is a pure rename if you prefer it.Scope: the PR covers the three mappings (
limittomemory.max,reservationtomemory.low, and theswap - limitconversion intomemory.swap.max). Should the two rejection paths (a swap value without a limit, and a swap value below the limit) be part of this PR, or a separate one? I left them out to keep this one small.saku3 commentedon Sep 11, 2026
I think adding memory_v2.rs is fine.
Personally, I'd like to eventually remove the v1 tests and have only v2 and systemd tests, so I think a directory structure like the following would be ideal:
ARMeeru commentedon Sep 12, 2026
Noted on #3727 as well, thank you.
One coordination point from my side: the memory tests in #3725 are unaffected by the v1 removal except for the
cgroup_v1_memoryregistration inmain.rs, which sits next to the lines #3727 deletes, so I expect a small rebase conflict there.Once #3727 merges, I'll rebase onto it and rename my file to
memory.rs, matching the flat per-controller layout you described. I'll hold off until then so I'm not building on an unmerged branch.test(contest): add cgroup v2 memory integration tests
test(contest): add cgroup v2 memory integration tests
3 remaining items
saku3 commentedon Sep 21, 2026
I agree. I think we should move them too.
test(contest): add cgroup v2 pids integration tests (#3741)
test(contest): migrate huge_tlb tests to cgroup v2 (#3752)
test(contest): add cgroup v2 cpuset integration tests (#3779)
test(contest): add cgroup v2 unified integration tests
test(contest): add cgroup v2 unified integration tests (#3806)
ARMeeru commentedon Oct 17, 2026
@saku3 status since the last check-in, for the coordination this thread set up:
Merged: memory (#3725), pids (#3741), hugetlb (#3752), cpuset (#3779) and unified (#3806) from me, and io from aayush0325 (#3731). cpu already had v2 coverage, and
systemd/arrived with #3721. The io work also covered the per-device BFQ weight test from runc's suite.Of the layout sketched on Sep 11, the one piece left without a test group is the cgroupfs devices controller. @t-akashi your
rust_oci_testbranch carries a cgroup v2 devices group (6e982da); now that #3721 turned the feature on by default, do you plan to send it? Happy to leave it with you. If you would rather pass it on, I'll pick the work up and rework it against what #3721 added.The one runc
cgroups.batstest with no coverage left is per-device multiple iops throughunified; I'll take that next. With devices in and that landed, every test in the reference suite has a home here.[-]Add integration tests for cgroup v2[/-][+]Add integration tests for cgroup v2 and systemd[/+]t-akashi commentedon Oct 18, 2026
Thank you for heads-up.
I'll try to rework my patch onto the latest (0.7.1).
Give me some time.
t-akashi commentedon Oct 20, 2026
@ARMeeru
After looking at my commit (6e982da), I concluded that we don't need this test case.
Basically it tests one scenario which, I think, is already covered by a few of your tests
(that is, test_whitelist_rules and test_redundant_deny_preserves_devices_access).
It also have two variants, an absolute path and a relative path for the "CgroupsPath", but it doesn't make sense as
youki supports only a particular format of "[slice]:[prefix]:[name] (crates/libcgroups/src/systemd/manager.rs).
You can ignore this commit.
fix(libcgroups): write each line of a unified value separately (#3831)
test(contest): add cgroup v2 pids integration tests (youki-dev#3741)
ARMeeru commentedon Nov 25, 2026
@saku3 Status update from current main and the latest runc nightly:
The controller groups from the proposed layout are now present, except for a dedicated cgroupfs
devices.rs. The per-device multiple-IOPS unified test is enabled and passes.For the device scope,
test_whitelist_rulesandtest_redundant_deny_preserves_device_accesspass--systemd-cgroup, so they cover the systemd driver only. The enabled runc device tests exercise cgroupfs instead. Is that runc coverage sufficient for this issue, or would you prefer a dedicated contest devices group?Two related runc tests are red in the nightly:
update cgroup v2 resources via unified mapgetscpu.weight17 where the pinned runc test expects 4. Current youki uses the newer quadratic shares-to-weight mapping, while the pinned runc helper uses the linear mapping. This needs test-baseline triage.update devices [minimal transition rules]fails during create because the device BPF parser rejects theain the test'srwaaccess rule.I suggest tracking those separately from this umbrella so this one stays about test coverage. Once we settle the device-scope question and have the failures tracked, would you be comfortable closing it?
saku3 commentedon Nov 25, 2026
Thank you for update.
I'd like to add cgroupfs device tests to contest. Once those are in place, I think we can close this issue.
test(contest): add cgroup v2 device integration tests