From b672eafcb0c68538d666ce488d6d47e1f263fd82 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 21 Apr 2021 09:12:39 -0400 Subject: [PATCH] Support multi-word cpusets From cpuset(7): > For masks longer than one word, a comma separator is used between > words. Words are displayed in big-endian order, which has the most > significant bit first. The hex digits within a word are also in > big-endian order. --- tests/ansible/tests/affinity_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ansible/tests/affinity_test.py b/tests/ansible/tests/affinity_test.py index 9572717f..fa0efb64 100644 --- a/tests/ansible/tests/affinity_test.py +++ b/tests/ansible/tests/affinity_test.py @@ -179,7 +179,8 @@ class LinuxPolicyTest(testlib.TestCase): try: for line in fp: if line.startswith('Cpus_allowed'): - return int(line.split()[1], 16) + mask = line.split()[1].replace(',', '') + return int(mask, 16) finally: fp.close()