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

Fix up all 0 serial check. #505

Merged
merged 1 commit into from
Mar 13, 2023
Merged

Fix up all 0 serial check. #505

merged 1 commit into from
Mar 13, 2023

Conversation

robputt
Copy link
Contributor

@robputt robputt commented Mar 13, 2023

Issue

How

Screenshots

References

Checklist

  • Tests added
  • Cleaned up commit history (rebase!)
  • Documentation added
  • Thought about variable and method names

@robputt robputt requested a review from a team as a code owner March 13, 2023 16:24
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@shawaj
Copy link
Member

shawaj commented Mar 13, 2023

@robputt we should add test cases for:

Case 1:
/proc/cpuinfo All zero serial - 0000000000000000
/proc/device-tree/serial valid serial RockPi - d18dbe5c2a58cc61

Should return the second one

Case 2:
/proc/cpuinfo - All zero serial - 0000000000000000
/proc/device-tree/serial - All zero serial - 0000000000000000
Should return all 0s

Case 3:
/proc/cpuinfo - valid serial RasPi - 000000009e3cb787
/proc/device-tree/serial - valid serial RasPi - 000000009e3cb787
Should return the serial

Case 4:
/proc/cpuinfo - valid serial RockPi - d18dbe5c2a58cc61
/proc/device-tree/serial - valid serial RasPi - 000000009e3cb787
Should return the RockPi serial

I'm not sure there's any good way to test for an invalid serial? Unless those RockPi ones have a specific format @KevinWassermann94 or a fixed value?

@shawaj
Copy link
Member

shawaj commented Mar 13, 2023

Also @robputt we should check for an empty serial there as well as all 0s, and revert to the other location as well in that case

@robputt robputt merged commit b0448ed into master Mar 13, 2023
@robputt robputt deleted the BUG_serial_check branch March 13, 2023 17:39
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.

2 participants