Debian builds in a chroot without cgroup mounted, so tests expecting
to access cgroup will fail with ENOMEDIUM, so skip the tests in that
situation.
r = cg_unified();
if (r == -ENOMEDIUM) {
- log_notice_errno(r, "Skipping cg hierarchy tests: %m");
+ log_tests_skipped("cgroup not mounted");
return;
}
assert_se(r >= 0);
int r;
r = cg_unified_cached(false);
- if (r < 0) {
- log_info_errno(r, "Skipping %s: %m", __func__);
+ if (r == -ENOMEDIUM) {
+ log_tests_skipped("cgroup not mounted");
return;
}
+ assert_se(r >= 0);
_cleanup_free_ char *here = NULL;
assert_se(cg_pid_get_path_shifted(0, NULL, &here) >= 0);
int r;
r = cg_unified();
+ if (r == -ENOMEDIUM) {
+ log_tests_skipped("cgroup not mounted");
+ return;
+ }
+ assert_se(r >= 0);
condition = condition_new(CONDITION_CONTROL_GROUP_CONTROLLER, "v1", false, false);
assert_se(condition);
int r;
r = cg_unified();
- if (r < 0) {
- log_notice_errno(r, "Skipping ConditionControlGroupController tests: %m");
+ if (r == -ENOMEDIUM) {
+ log_tests_skipped("cgroup not mounted");
return;
}
+ assert_se(r >= 0);
/* Invalid controllers are ignored */
condition = condition_new(CONDITION_CONTROL_GROUP_CONTROLLER, "thisisnotarealcontroller", false, false);