-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/int: swap-related fixes #4188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, when we set memory to -1 in cgroupv2, it means set both memory and swap limit to max:
runc/tests/integration/update.bats
Lines 119 to 121 in a837eeb
# try to remove memory limit | |
runc update test_update --memory -1 | |
[ "$status" -eq 0 ] |
@lifubang I'm not sure why this comment is related to this PR. In here I am just fixing some issues with the test. |
runc/tests/integration/update.bats Lines 119 to 121 in a837eeb
Indeed it does remove both memory and swap limits in v2, and the test is checking it (see commit commit 18ebc51). IOW it's not a bug, it's a feature. (and I still don't understand how this question relates to this PR) |
Because with your patch, I still can get an error when test this case. This is because: so, need to move this test to the if condition check: runc/tests/integration/update.bats Line 120 in a837eeb
|
Thanks, I think I understand it now. Added two more commits, untested locally, please give it a try @lifubang. |
I'll check it later, once I'm sitting in the front of my PC with an old kernel. |
If swap is disabled, we should not run swap tests. Fixes 4166. Signed-off-by: Kir Kolyshkin <[email protected]>
1. Add "-maxdepth 2" to not dive too deep into cgroup hierarchy. 2. Add "-type f" to look for a regular file. Signed-off-by: Kir Kolyshkin <[email protected]>
In case of cgroup v2, there's no memory.swap.max in the top-level cgroup, so we have to use find. Signed-off-by: Kir Kolyshkin <[email protected]>
When swap is being disabled (as set to 0), or set to max, ignore non-existent memory.swap.max cgroup file. If swap is being set explicitly to some value, do return an error like before. Signed-off-by: Kir Kolyshkin <[email protected]>
There are cgroup v2 systems out there that do not have cgroup swap enabled, and this test will probably fail in there. Move it to a separate case, guarded with requires cgroups_swap. Signed-off-by: Kir Kolyshkin <[email protected]>
Maybe the forth commit(4209439) should be backported to release-1.1? |
See individual commits for details.
Fixes #4166