_cleanup_free_ char *cgroup = NULL;
ManagedOOMPreference root_pref;
OomdCGroupContext *c1, *c2;
+ CGroupMask mask;
bool test_xattrs;
int root_xattrs, r;
if (cg_all_unified() <= 0)
return (void) log_tests_skipped("cgroups are not running in unified mode");
+ assert_se(cg_mask_supported(&mask) >= 0);
+
+ if (!FLAGS_SET(mask, CGROUP_MASK_MEMORY))
+ return (void) log_tests_skipped("cgroup memory controller is not available");
+
assert_se(cg_pid_get_path(NULL, 0, &cgroup) >= 0);
/* If we don't have permissions to set xattrs we're likely in a userns or missing capabilities