-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils/cpu: Check cpu list for s390x [v3] #2353
utils/cpu: Check cpu list for s390x [v3] #2353
Conversation
The output in /proc/cpuinfo is different between s390x and other archs. This is to support to parse the output on s390x. Signed-off-by: Dan Zheng <[email protected]> Signed-off-by: Cleber Rosa <[email protected]>
This simple test, after the s390x version, checks the proper parsing of and x86_64 /proc/cpuinfo. Signed-off-by: Cleber Rosa <[email protected]>
clflush size : 64 | ||
cache_alignment : 64 | ||
address sizes : 39 bits physical, 48 bits virtual | ||
power management: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's long 😄 anyway good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, unfortunately inspekt
does not treat the empty lines properly. Would you please use an external file instead of in-code representation? (or whatever makes inspekt happy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually indent
messing with the actual content of the strings. inspekt indent --fix selftest/unit/test_utils_cpu.py
shows how it adds a space between the key and value.
I'm skipping the indent check for this one file, and filing an issue in inspektor:
with mock.patch('avocado.utils.cpu.platform.machine', return_value='x86_64'): | ||
with mock.patch('avocado.utils.cpu.open', | ||
return_value=self._get_file_mock(x86_64)): | ||
self.assertEqual(len(cpu.cpu_online_list()), 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw I just noticed the simplified check, maybe later we could introduce better check to actually see which cpus are enabled as this function is suppose to detect the online cpu numbers is not just the total count... (eg. on Power with disabled threading is usually 0 8 16 32 ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always expand the test coverage, surely a good thing.
The output in /proc/cpuinfo is different between s390x and other archs.
This is to support to parse the output on s390x.
Signed-off-by: Dan Zheng [email protected]
Signed-off-by: Cleber Rosa [email protected]
Changes from v2 (#2351):
Changes from v1 (#2300):
/proc/cpuinfo
on s390x