Repository navigation
cpu: add regression test for non key:value lines in /proc/cpuinfo - #467
Merged
Merged
Conversation
add a simple test for a cpuinfo file that has lines without ':' and therefore crashed the code. This test is based on the description of the commit with the fix Signed-off-by: Christoph Ostarek <christoph@zededa.com>
europaul
marked this pull request as draft
July 7, 2026 13:57
Owner
|
@europaul did you want to take this out of draft state? |
europaul
marked this pull request as ready for review
July 8, 2026 09:28
Contributor
Author
yes, sorry for the confusion :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a targeted regression test (
TestQualcommCPUInfo) for/proc/cpuinfocontents thatcontain lines without a
:separator, as seen on some Qualcomm ARM SoCs (e.g. QCM6125),where the SoC name appears on a line of its own:
Why
Older ghw crashed on such lines. The underlying bug was already fixed upstream (#441, #443),
but there is no synthetic regression test locking that behavior in — the existing cpu tests
are all snapshot-fixture based. This test builds a minimal chroot with such a cpuinfo file
and asserts
cpu.Newsucceeds and reports exactly one processor.We (Zededa) hit this on real devices while using ghw for hardware inventory in
lf-edge/eve; this ports the test from our fork.
Testing
go test ./pkg/cpu/...passes on Linux.