]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests-068: avoid enabling controller on leaf cgroup node
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 12 Apr 2023 14:30:34 +0000 (14:30 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 12 Apr 2023 17:07:41 +0000 (11:07 -0600)
cgroup v2, has no internal process constraint, where the process runs
only on the leaf node of the cgroup hierarchy and no controllers should
be enabled on the leaf cgroup node too. Let's not enable cpu controller
on the leaf cgroup node.

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

tests/ftests/068-sudo-systemd_cgexec-v2.py

index 4bb1814192d8269b9c030d36d035ededa53cc74c..78945f9afa52d28f612e302de61b4a4008e3598f 100755 (executable)
@@ -66,15 +66,14 @@ def setup(config):
 
     # With cgroup v2, we can't enable controller for the child cgroup, while
     # a task is attached to test068.scope. Attach the task from test068.scope
-    # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent
-    # and then in the SYSTEMD_CGNAME cgroup, so that the cgroup.get() works
+    # to child cgroup SYSTEMD_CGNAME and then enable cpu controller in the parent,
+    # so that the cgroup.get() works
     Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.procs', value=pid)
 
     Cgroup.set(
                 config, cgname=(os.path.join(SLICE, SCOPE)), setting='cgroup.subtree_control',
                 value='+cpu', ignore_systemd=True
               )
-    Cgroup.set(config, cgname=SYSTEMD_CGNAME, setting='cgroup.subtree_control', value='+cpu')
 
     # create and check if the cgroup was created under the controller root
     if not Cgroup.create_and_validate(config, CONTROLLER, OTHER_CGNAME, ignore_systemd=True):