From: Kamalesh Babulal Date: Wed, 12 Apr 2023 09:34:19 +0000 (+0000) Subject: Revert "gunit/test-015: Populate subtree_control for leaf cgroup" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33e22f7991b4a1c7adee779c8891a00957c724c8;p=thirdparty%2Flibcgroup.git Revert "gunit/test-015: Populate subtree_control for leaf cgroup" 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 Signed-off-by: Tom Hromatka (cherry picked from commit f15c995d56be0c13b03ea9ca43919cca261be9b6) --- diff --git a/tests/gunit/015-cgroupv2_controller_enabled.cpp b/tests/gunit/015-cgroupv2_controller_enabled.cpp index 25d2e7c1..f5ad47c2 100644 --- a/tests/gunit/015-cgroupv2_controller_enabled.cpp +++ b/tests/gunit/015-cgroupv2_controller_enabled.cpp @@ -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)