From: Kamalesh Babulal Date: Fri, 12 Apr 2024 10:18:45 +0000 (+0530) Subject: ftests/038: fix cpuset_exclusive oddity X-Git-Tag: v3.2.0~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=688de5ad287d74f1bee34e6bfa4ab42d949d4485;p=thirdparty%2Flibcgroup.git ftests/038: fix cpuset_exclusive oddity With upstream commit 7476a636d3100 ("cgroup/cpuset: Show invalid partition reason string"), doesn't return error but needs to be re-read again. This oddity is seen in kernel >= 6.5, fix it by introducing some checks for cpuset_exclusive oddity. ----------------------------------------------------------------- Test Results: Run Date: Apr 12 10:20:07 Passed: 1 test(s) Skipped: 0 test(s) Failed: 0 test(s) ----------------------------------------------------------------- Timing Results: Test Time (sec) -------------------------------------------- setup 0.00 038-cgxget-cpuset_settings.py 24.75 teardown 0.00 -------------------------------------------- Total Run Time 24.75 Fixes: https://github.com/libcgroup/libcgroup/issues/423 Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/tests/ftests/038-cgxget-cpuset_settings.py b/tests/ftests/038-cgxget-cpuset_settings.py index 8af6d874..575baf3b 100755 --- a/tests/ftests/038-cgxget-cpuset_settings.py +++ b/tests/ftests/038-cgxget-cpuset_settings.py @@ -88,6 +88,21 @@ def setup(config): Cgroup.create(config, CONTROLLER, CGNAME) +def is_cpuset_exclusive_oddity(entry, out): + # upstream commit 7476a636d3100 ("cgroup/cpuset: Show invalid + # partition reason string"), doesn't return error but needs to be + # read again + if (entry[0] == 'cpuset.cpu_exclusive' and entry[1] == '1' and + (out == '0' or out[:12] == "root invalid")): + return True + + if (entry[0] == 'cpuset.cpus.partition' and entry[1] == 'root' and + (out == '0' or out[:12] == 'root invalid')): + return True + + return False + + def test(config): result = consts.TEST_PASSED cause = None @@ -107,6 +122,9 @@ def test(config): version=entry[5], values_only=True, print_headers=False) if out != entry[4]: + if (is_cpuset_exclusive_oddity(entry, out)): + continue + result = consts.TEST_FAILED cause = ( 'After setting {}={}, expected {}={}, but received '