diff options
Diffstat (limited to 'runtime/test/large_module_gate_test.cpp')
| -rw-r--r-- | runtime/test/large_module_gate_test.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/test/large_module_gate_test.cpp b/runtime/test/large_module_gate_test.cpp index ed8d18a0c..d114095fd 100644 --- a/runtime/test/large_module_gate_test.cpp +++ b/runtime/test/large_module_gate_test.cpp | |||
| @@ -136,6 +136,15 @@ static int cgroup_limits_are_read_up_the_tree() { | |||
| 136 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == 2000); | 136 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == 2000); |
| 137 | write_file(root / "cg/user.slice/app.scope/memory.current", "7000\n"); // over its limit: no room | 137 | write_file(root / "cg/user.slice/app.scope/memory.current", "7000\n"); // over its limit: no room |
| 138 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == 0); | 138 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == 0); |
| 139 | // A mount rooted at a constrained cgroup still exposes its budget at the mount root. | ||
| 140 | write_file(root / "cg/user.slice/app.scope/memory.max", "max\n"); | ||
| 141 | write_file(root / "cg/memory.max", "5000\n"); | ||
| 142 | write_file(root / "cg/memory.current", "3000\n"); | ||
| 143 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == 2000); | ||
| 144 | write_file(root / "self", "0::/\n"); | ||
| 145 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == 2000); | ||
| 146 | write_file(root / "cg/memory.max", "max\n"); | ||
| 147 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == UINT64_MAX); | ||
| 139 | write_file(root / "self", "12:memory:/legacy\n"); // cgroup v1 only: no limit read | 148 | write_file(root / "self", "12:memory:/legacy\n"); // cgroup v1 only: no limit read |
| 140 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == UINT64_MAX); | 149 | CHECK(leonida::cgroup_memory_room((root / "self").string(), (root / "cg").string()) == UINT64_MAX); |
| 141 | CHECK(leonida::cgroup_memory_room((root / "missing").string(), (root / "cg").string()) == UINT64_MAX); | 150 | CHECK(leonida::cgroup_memory_room((root / "missing").string(), (root / "cg").string()) == UINT64_MAX); |