]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Revert "gunit/test-015: Populate subtree_control for leaf cgroup"
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 12 Apr 2023 09:34:19 +0000 (09:34 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 12 Apr 2023 17:07:41 +0000 (11:07 -0600)
This reverts commit 328ec5e8e4f00790cb91f81ff53f2cdd42d0106f.

Revert the logic to rely on the leaf cgroup node's subtree_control file
to examine the enabled controllers, this breaks the cgroup v2's no
internal process constraint and fallback to the original idea of relying
upon on leaf cgroup nodes, parent subtree_control to examine the enabled
controllers.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit f15c995d56be0c13b03ea9ca43919cca261be9b6)

tests/gunit/015-cgroupv2_controller_enabled.cpp

index 25d2e7c1f76a5252d9262d1cfdbd92a0a9404a15..f5ad47c2fde66dd34c3c71fdee246d13a1a2c8c4 100644 (file)
@@ -54,7 +54,6 @@ class CgroupV2ControllerEnabled : public ::testing::Test {
        void InitChildDir(const char dirname[])
        {
                char tmp_path[FILENAME_MAX] = {0};
-               FILE *f;
                int ret;
 
                /* create the directory */
@@ -62,14 +61,6 @@ class CgroupV2ControllerEnabled : public ::testing::Test {
                         PARENT_DIR, dirname);
                ret = mkdir(tmp_path, MODE);
                ASSERT_EQ(ret, 0);
-
-               snprintf(tmp_path, FILENAME_MAX - 1,
-                        "%s/%s/cgroup.subtree_control", PARENT_DIR, dirname);
-
-               f = fopen(tmp_path, "w");
-               ASSERT_NE(f, nullptr);
-               fprintf(f, "cpu io memory pids\n");
-               fclose(f);
        }
 
        void InitMountTable(void)