Skip to content

Add bios metadata to submission json (new)#2410

Merged
Hook25 merged 4 commits into
mainfrom
add-bios-metadata-to-submission-json
Mar 23, 2026
Merged

Add bios metadata to submission json (new)#2410
Hook25 merged 4 commits into
mainfrom
add-bios-metadata-to-submission-json

Conversation

@pieqq

@pieqq pieqq commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Update device-bios script with a new bios subcommand that extracts data from /sys/class/dmi/id/bios_* files and returns them as JSON. Sysfs is accessed directly (instead of using dmidecode, for instance) since these files are user-readable (while dmidecode requires root access).

The collector version is bumped to v5.

Resolved issues

Fix CHECKBOX-2191

Documentation

Tests

Tested locally:

$ device-info bios
{
    "date": "09/18/2025",
    "release": "5.35",
    "vendor": "American Megatrends International, LLC.",
    "version": "F8d"
}

pieqq added 2 commits March 20, 2026 16:35
`dmidecode` provides more information, but it requires root.

However, the `/sys/class/dmi/id/bios_*` files that dmidecode rely on to
provide BIOS-related information can be accessed by any user, so the
get_bios_info() function makes use of it to return a basic dict with the
available data.
@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.18%. Comparing base (a948598) to head (6b8a45a).
⚠️ Report is 122 commits behind head on main.

Files with missing lines Patch % Lines
...box-ng/plainbox/impl/session/system_information.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2410      +/-   ##
==========================================
+ Coverage   58.15%   58.18%   +0.02%     
==========================================
  Files         475      475              
  Lines       47761    47796      +35     
  Branches     8492     8497       +5     
==========================================
+ Hits        27775    27809      +34     
- Misses      19103    19104       +1     
  Partials      883      883              
Flag Coverage Δ
checkbox-ng 75.88% <97.22%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Hook25
Hook25 previously approved these changes Mar 20, 2026

@Hook25 Hook25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but consider the following, I don't like that the keys /may/ change. It does, on core16 only these are present: (both core16 and uc16)

ubuntu@ubuntu-16-04:~$ cat /sys/class/dmi/id/bios_
bios_date     bios_vendor   bios_version  

Comment thread checkbox-ng/checkbox_ng/support/device_info.py
Comment thread checkbox-ng/checkbox_ng/support/device_info.py Outdated
This is to prevent a bug in python3.5 when running the unit tests, since
dictionaries are unordered.
@Hook25 Hook25 merged commit b4a2db1 into main Mar 23, 2026
45 checks passed
@Hook25 Hook25 deleted the add-bios-metadata-to-submission-json branch March 23, 2026 08:19
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