test-cgroup-util: skip cg hierarchy tests when necessary (#7371)

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-11-17 11:10:21 +01:00 committed by Lennart Poettering
parent bb84995789
commit 05d69e0294
1 changed files with 7 additions and 2 deletions

View File

@ -372,9 +372,14 @@ static void test_is_wanted(void) {
}
static void test_cg_tests(void) {
int all, hybrid, systemd;
int all, hybrid, systemd, r;
assert_se(cg_unified_flush() == 0);
r = cg_unified_flush();
if (r == -ENOMEDIUM) {
log_notice_errno(r, "Skipping cg hierarchy tests: %m");
return;
}
assert_se(r == 0);
all = cg_all_unified();
assert_se(IN_SET(all, 0, 1));