-
Notifications
You must be signed in to change notification settings - Fork 343
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 [v4] #2357
utils/cpu: Check cpu list for s390x [v4] #2357
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]>
@@ -115,7 +115,8 @@ if [ "$TRAVIS" == "true" ]; then | |||
else | |||
run_rc lint 'inspekt lint --exclude=.git --enable W0102,W0611' | |||
fi | |||
run_rc indent 'inspekt indent --exclude=.git' | |||
# Skip checking test_utils_cpu.py due to inspektor bug |
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.
Do we have a way to monitor the bug status? If yes, please include the check in selftests/functional/test_thirdparty_bugs.py
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.
Yep, good point. This is also tracked in GitHub. Will add it.
selftests/unit/test_utils_cpu.py
Outdated
@@ -87,6 +87,229 @@ def test_s390x(self): | |||
return_value=self._get_file_mock(s390x_2)): | |||
self.assertEqual(len(cpu.cpu_online_list()), 4) | |||
|
|||
def test_x86_64(self): | |||
x86_64 = u"""processor : 0 | |||
vendor_id : GenuineIntel |
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.
Please move this content to selftests/.data
.
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.
I tend to favor inline content, for both locality and for making packaging easier. It looks like you meant that moving this to a file is a must, but please clarify that to me and I'll take a look at it.
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.
No, not a must, just a soft-request. You can keep it here.
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 v3 (#2353):
Changes from v2 (#2351):
Changes from v1 (#2300):
/proc/cpuinfo
on s390x