]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/testing/selftests/cgroup/test_core.c
kselftest/cgroup: fix incorrect test_core skip
[linux.git] / tools / testing / selftests / cgroup / test_core.c
index be59f9c34ea21dc0de01bbb75f6f970f6ed2504b..79053a4f47838407a557eb1f83dbf47ff6276ca0 100644 (file)
@@ -198,7 +198,7 @@ static int test_cgcore_no_internal_process_constraint_on_threads(const char *roo
        char *parent = NULL, *child = NULL;
 
        if (cg_read_strstr(root, "cgroup.controllers", "cpu") ||
-           cg_read_strstr(root, "cgroup.subtree_control", "cpu")) {
+           cg_write(root, "cgroup.subtree_control", "+cpu")) {
                ret = KSFT_SKIP;
                goto cleanup;
        }
@@ -376,6 +376,11 @@ int main(int argc, char *argv[])
 
        if (cg_find_unified_root(root, sizeof(root)))
                ksft_exit_skip("cgroup v2 isn't mounted\n");
+
+       if (cg_read_strstr(root, "cgroup.subtree_control", "memory"))
+               if (cg_write(root, "cgroup.subtree_control", "+memory"))
+                       ksft_exit_skip("Failed to set memory controller\n");
+
        for (i = 0; i < ARRAY_SIZE(tests); i++) {
                switch (tests[i].fn(root)) {
                case KSFT_PASS: