From: Tom Hromatka Date: Fri, 18 Mar 2022 15:41:20 +0000 (-0600) Subject: tests: Ignore cpuset exclusive errors in test 038 X-Git-Tag: v3.1.0~308^2~2^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acbfaa6d6ed10cd7e2e8bd5497dd3a7cfe7cdae2;p=thirdparty%2Flibcgroup.git tests: Ignore cpuset exclusive errors in test 038 Setting the cpuset exclusive can be challenging because other cgroups could be using the cpu that is slated to become exclusive to this cgroup. Add try/except handling to test 038 for when we can't get the exclusive bit set, so that the test doesn't fail due to circumstances beyond libcgroup's control. Signed-off-by: Tom Hromatka --- diff --git a/ftests/038-cgxget-cpuset_settings.py b/ftests/038-cgxget-cpuset_settings.py index 720e1791..b376ecbe 100755 --- a/ftests/038-cgxget-cpuset_settings.py +++ b/ftests/038-cgxget-cpuset_settings.py @@ -8,7 +8,7 @@ # from cgroup import Cgroup, CgroupVersion -from run import Run +from run import Run, RunError import consts import ftests import sys @@ -94,8 +94,15 @@ def test(config): cause = None for entry in TABLE: - Cgroup.xset(config, cgname=CGNAME, setting=entry[0], value=entry[1], - version=entry[2]) + try: + Cgroup.xset(config, cgname=CGNAME, setting=entry[0], + value=entry[1], version=entry[2]) + except RunError as re: + if re.stderr.find('Invalid argument') >= 0: + # The kernel disallowed this setting, likely due to the many + # complexities of exclusive cpusets + continue + raise re out = Cgroup.xget(config, cgname=CGNAME, setting=entry[3], version=entry[5], values_only=True,