From acbfaa6d6ed10cd7e2e8bd5497dd3a7cfe7cdae2 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Fri, 18 Mar 2022 09:41:20 -0600 Subject: [PATCH] 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 --- ftests/038-cgxget-cpuset_settings.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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, -- 2.47.3