]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests: Fix test 005 on Cgroup v2 Ubuntu22
authorTom Hromatka <tom.hromatka@oracle.com>
Thu, 27 Mar 2025 15:28:28 +0000 (15:28 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 28 Mar 2025 13:52:03 +0000 (07:52 -0600)
Test 005-cgsnapshot-basic_snapshot_v2.py was failing on Ubuntu22
(non-sudo tests) because the cpuset.cpus.exclusive.effective field
is no longer being reported by the kernel in that case.

Remove that line from the expected output for the non-sudo tests but
leave it in for the sudo tests as it's still reported there.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Acked-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
tests/ftests/005-cgsnapshot-basic_snapshot_v2.py

index 4ee80bc1acc20e8f8f1a679e748c97519d1ce7f0..4027c90aa7cad0a6892014ff5414f0581b676dc6 100755 (executable)
@@ -23,6 +23,14 @@ CGSNAPSHOT = [
                     cpuset.cpus="";
             }
     }""",
+    """group 005cgsnapshot {
+            cpuset {
+                    cpuset.cpus.exclusive="";
+                    cpuset.cpus.partition="member";
+                    cpuset.mems="";
+                    cpuset.cpus="";
+            }
+    }""",
     """group 005cgsnapshot {
             cpuset {
                     cpuset.cpus.exclusive.effective="";
@@ -56,12 +64,15 @@ def test(config):
 
     expected_1 = Cgroup.snapshot_to_dict(CGSNAPSHOT[0])
     expected_2 = Cgroup.snapshot_to_dict(CGSNAPSHOT[1])
+    expected_sudo = Cgroup.snapshot_to_dict(CGSNAPSHOT[2])
     actual = Cgroup.snapshot(config, controller=CONTROLLER)
 
     if (
             expected_1[CGNAME].controllers[CONTROLLER] !=
             actual[CGNAME].controllers[CONTROLLER] and
             expected_2[CGNAME].controllers[CONTROLLER] !=
+            actual[CGNAME].controllers[CONTROLLER] and
+            expected_sudo[CGNAME].controllers[CONTROLLER] !=
             actual[CGNAME].controllers[CONTROLLER]
        ):
         result = consts.TEST_FAILED