Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

tests: add SMBIOS coverage for modes sysinfo/host#152

Merged
Coffeeri merged 3 commits into
cyberus-technology:mainfrom
Coffeeri:feat/smbios
Feb 10, 2026
Merged

tests: add SMBIOS coverage for modes sysinfo/host#152
Coffeeri merged 3 commits into
cyberus-technology:mainfrom
Coffeeri:feat/smbios

Conversation

@Coffeeri
Copy link
Copy Markdown
Contributor

@Coffeeri Coffeeri commented Feb 5, 2026

This PR adds test coverage for SMBIOS handling in both libvirt SMBIOS modes:
sysinfo and host.

For mode=sysinfo, the tests verify that SMBIOS System Information fields
configured via libvirt XML are correctly exposed inside the guest. The
expected system and chassis fields are validated using dmidecode, and the
chassis asset tag is additionally checked via sysfs.

For mode=host, the tests validate that SMBIOS data is correctly propagated
from the host to the guest using dmidecode, and that the UUID handling
matches the documented behavior (UUID must be explicitly defined in the
domain XML).

These tests improve coverage of SMBIOS behavior and help ensure consistent
exposure of system information across libvirt configurations.

Related PRs:

@Coffeeri Coffeeri self-assigned this Feb 5, 2026
@Coffeeri Coffeeri force-pushed the feat/smbios branch 2 times, most recently from ef2b82b to 915f5ce Compare February 5, 2026 16:48
Copy link
Copy Markdown
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

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

very nice first contribution to this repo :) Left a few remarks

Comment thread images/nixos-image.nix
Comment thread tests/common.nix
Comment thread tests/common.nix Outdated
Comment thread tests/common.nix Outdated
@Coffeeri Coffeeri force-pushed the feat/smbios branch 7 times, most recently from 4f61d96 to 41f7052 Compare February 6, 2026 16:02
@Coffeeri Coffeeri changed the title tests: add smbios test tests: add SMBIOS coverage for modes sysinfo/host Feb 6, 2026
@Coffeeri Coffeeri marked this pull request as ready for review February 6, 2026 16:07
@Coffeeri Coffeeri requested a review from phip1611 February 6, 2026 16:07
Copy link
Copy Markdown
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

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

Nice work! :) left a few remarks

Comment thread tests/common.nix Outdated
Comment thread tests/common.nix Outdated
Comment thread tests/common.nix
Comment thread tests/common.nix Outdated
Comment thread tests/common.nix
Comment thread tests/testsuite_default.py Outdated
Comment thread tests/testsuite_default.py
Comment thread tests/common.nix
@Coffeeri Coffeeri force-pushed the feat/smbios branch 6 times, most recently from 3390454 to c574850 Compare February 9, 2026 10:08
Comment thread tests/testsuite_default.py Outdated
@hertrste
Copy link
Copy Markdown
Collaborator

hertrste commented Feb 9, 2026

Very nice tests!

Comment thread flake.nix Outdated
Add a test that verifies SMBIOS System Information fields provided via
libvirt sysinfo configuration and exposed inside the guest.

The test checks the expected system and partial chassis fields using `dmidecode`
and additionally validates the chassis asset tag via sysfs.

The test validates the following fields using `dmidecode -s`:
  - system-manufacturer
  - system-product-name
  - system-version
  - system-serial-number
  - system-uuid
  - system-sku-number
  - system-family
  - chassis-asset-tag

The chassis asset tag is additionally verified via:
  /sys/devices/virtual/dmi/id/chassis_asset_tag

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
In host mode, libvirt extracts SMBIOS data from the host using `dmidecode`
and propagates it to Cloud Hypervisor via the --platform option.

The UUID is not propagated automatically and must be explicitly defined
in the libvirt XML configuration, as documented:

  copy all of Block 0 and Block 1, except for the UUID, from the host's SMBIOS values

This commit adds a test that validates the expected SMBIOS fields when
using smbios mode=host.

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
This test checks the SMBBIOS Type 11 OEM Strings,
which are overwritten using the nix generated libvirt XML.

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
@Coffeeri Coffeeri enabled auto-merge February 10, 2026 13:41
@Coffeeri Coffeeri added this pull request to the merge queue Feb 10, 2026
Merged via the queue into cyberus-technology:main with commit 0ae2ca8 Feb 10, 2026
3 checks passed
@Coffeeri Coffeeri deleted the feat/smbios branch February 10, 2026 13:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants