diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-02-18 23:28:15 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-20 19:48:16 -0400 |
commit | c2ef6f8427031e17dd2ea3fe232959687c77ea82 (patch) | |
tree | 4244ca53be65bcdfe30afec4f0d1d107bdf9c8e1 /src/test/test-cgroup-mask.c | |
parent | 1cd974edfd7cd91dcdf321e7202bd220bac50a2d (diff) |
test-cgroup-mask: pass on kernels without memory controller
It seems that unit_get_siblings_mask returns the controllers
filtered by what is available, but get_members_mask and
get_cgroup_mask do not. This just fixes the test following the
symptoms.
Diffstat (limited to 'src/test/test-cgroup-mask.c')
-rw-r--r-- | src/test/test-cgroup-mask.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c index a230c97779..5c82363b7b 100644 --- a/src/test/test-cgroup-mask.c +++ b/src/test/test-cgroup-mask.c @@ -82,20 +82,20 @@ 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)); - assert(unit_get_siblings_mask(daughter) == (CGROUP_CPU | CGROUP_CPUACCT)); + 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(grandchild) == 0); - assert(unit_get_siblings_mask(parent_deep) == (CGROUP_CPU | CGROUP_CPUACCT)); - assert(unit_get_siblings_mask(parent) == (CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO)); - assert(unit_get_siblings_mask(root) == (CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO)); + 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)); /* Verify aggregation of target masks. */ - assert(unit_get_target_mask(son) == (CGROUP_CPU | CGROUP_CPUACCT)); - assert(unit_get_target_mask(daughter) == (CGROUP_CPU | CGROUP_CPUACCT)); + 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(grandchild) == 0); - assert(unit_get_target_mask(parent_deep) == (CGROUP_CPU | CGROUP_CPUACCT | CGROUP_MEMORY)); - assert(unit_get_target_mask(parent) == (CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY)); - assert(unit_get_target_mask(root) == (CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY)); + 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)); + assert(unit_get_target_mask(root) == ((CGROUP_CPU | CGROUP_CPUACCT | CGROUP_BLKIO | CGROUP_MEMORY) & m->cgroup_supported)); manager_free(m); |