chiark / gitweb /
test-cgroup-mask: fix masks in test and enable by default
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 18 Jul 2014 21:50:04 +0000 (17:50 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 20 Jul 2014 23:48:16 +0000 (19:48 -0400)
Commit 637f421e5c6a ("cgroups: always propagate controller membership
to siblings") changed the mask propagation logic, but the test wasn't
updated.

Move to normal tests from manual tests, it should not touch the system
anymore.

Makefile.am
src/test/test-cgroup-mask.c

index 5857863..91ecbe4 100644 (file)
@@ -1230,7 +1230,6 @@ manual_tests += \
        test-hostname \
        test-daemon \
        test-cgroup \
-       test-cgroup-mask \
        test-install \
        test-watchdog \
        test-log \
@@ -1243,6 +1242,7 @@ endif
 
 tests += \
        test-engine \
+       test-cgroup-mask \
        test-job-type \
        test-env-replace \
        test-strbuf \
index 5c82363..f98e1bb 100644 (file)
@@ -82,16 +82,16 @@ static int test_cgroup_mask(void) {
         assert(unit_get_members_mask(root) == (CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY));
 
         /* Verify aggregation of sibling masks. */
-        assert(unit_get_siblings_mask(son) == ((CGROUP_CPU | CGROUP_CPUACCT) & m->cgroup_supported));
-        assert(unit_get_siblings_mask(daughter) == ((CGROUP_CPU | CGROUP_CPUACCT) & m->cgroup_supported));
+        assert(unit_get_siblings_mask(son) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY) & m->cgroup_supported));
+        assert(unit_get_siblings_mask(daughter) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY) & m->cgroup_supported));
         assert(unit_get_siblings_mask(grandchild) == 0);
-        assert(unit_get_siblings_mask(parent_deep) == ((CGROUP_CPU | CGROUP_CPUACCT) & m->cgroup_supported));
-        assert(unit_get_siblings_mask(parent) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO) & m->cgroup_supported));
-        assert(unit_get_siblings_mask(root) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO) & m->cgroup_supported));
+        assert(unit_get_siblings_mask(parent_deep) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY) & m->cgroup_supported));
+        assert(unit_get_siblings_mask(parent) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY) & m->cgroup_supported));
+        assert(unit_get_siblings_mask(root) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY) & m->cgroup_supported));
 
         /* Verify aggregation of target masks. */
-        assert(unit_get_target_mask(son) == ((CGROUP_CPU | CGROUP_CPUACCT) & m->cgroup_supported));
-        assert(unit_get_target_mask(daughter) == ((CGROUP_CPU | CGROUP_CPUACCT) & m->cgroup_supported));
+        assert(unit_get_target_mask(son) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY) & m->cgroup_supported));
+        assert(unit_get_target_mask(daughter) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY) & m->cgroup_supported));
         assert(unit_get_target_mask(grandchild) == 0);
         assert(unit_get_target_mask(parent_deep) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY) & m->cgroup_supported));
         assert(unit_get_target_mask(parent) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY) & m->cgroup_supported));