summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-03 19:50:37 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-04 09:07:31 +0200
commit5f4c5fef66581383ee852b301db67f687663004c (patch)
treeefe120b7e83aa5f4f0539a72a26ad1e6f66131da /src/test
parentba09d9c687986305e5b60f923e85e2ec1e78d979 (diff)
cgroup: always read the supported controllers from the root cgroup of the local container
Otherwise we might end up thinking that we support more controllers than actually enabled for the container we are running in.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-cgroup-util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
index ecc9d70bf4..ff7e45901c 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -295,6 +295,17 @@ static void test_shift_path(void) {
test_shift_path_one("/foobar/waldo", "/fuckfuck", "/foobar/waldo");
}
+static void test_mask_supported(void) {
+
+ CGroupMask m;
+ CGroupController c;
+
+ assert_se(cg_mask_supported(&m) >= 0);
+
+ for (c = 0; c < _CGROUP_CONTROLLER_MAX; c++)
+ printf("'%s' is supported: %s\n", cgroup_controller_to_string(c), yes_no(m & CGROUP_CONTROLLER_TO_MASK(c)));
+}
+
int main(void) {
test_path_decode_unit();
test_path_get_unit();
@@ -309,6 +320,7 @@ int main(void) {
test_controller_is_valid();
test_slice_to_path();
test_shift_path();
+ test_mask_supported();
return 0;
}