Skip to content
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

Closed

Conversation

clebergnu
Copy link
Contributor

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):

  • Added x86_64 test

Changes from v1 (#2300):

  • Added unittests considering a real and slightly faked output from /proc/cpuinfo on s390x

dzhengfy and others added 2 commits December 14, 2017 12:01
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
Copy link
Contributor

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

Copy link
Contributor Author

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.

@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants