Skip to content

Add boot log error checking tests to coreboot base port suite - #1251

Open
Houmgaor wants to merge 1 commit into
Dasharo:developfrom
Houmgaor:add-boot-log-error-checks
Open

Add boot log error checking tests to coreboot base port suite#1251
Houmgaor wants to merge 1 commit into
Dasharo:developfrom
Houmgaor:add-boot-log-error-checks

Conversation

@Houmgaor

Copy link
Copy Markdown

Closes: #921

This PR adds 5 new Robot Framework test cases (CBP007-CBP011) to the coreboot base port test suite. It parses boot logs for common errors and warnings indicating firmware misconfiguration.

Error patterns checked

Each test boots into Linux, reads the full coreboot log via cbmem -1, and checks for absence of a specific error pattern:

Test Description Pattern Reference
CBP007.001 No ASSERTION ERROR in boot log ASSERTION ERROR dasharo-issues#1409
CBP008.001 No missing static PCI devices not found, disabling it. dasharo-issues#1409
CBP009.001 No resource allocation failures Resource didn't fit!!! dasharo-issues#1364
CBP010.001 No BUG messages BUG: dasharo-issues#1364
CBP011.001 No devicetree.cb warnings Check your devicetree.cb dasharo-issues#1409

Changes

dasharo-compatibility/coreboot-base-port.robot

  • Added 5 test cases following existing CBP001-CBP006 conventions
  • Each test is gated by ${BASE_PORT_LOG_CHECK_SUPPORT} and ${TESTS_IN_UBUNTU_SUPPORT}
  • Tests boot into Linux via Boot System Or From Connected Disk, then read the coreboot console log via cbmem -1 and assert it does not contain the error pattern

platform-configs/include/default.robot

  • Added ${BASE_PORT_LOG_CHECK_SUPPORT} flag (defaults to ${FALSE})

platform-configs/qemu.robot

  • Enabled ${BASE_PORT_LOG_CHECK_SUPPORT} for QEMU testing
  • Tests pass on QEMU when no errors/warnings are present (as specified in coreboot base port suite #921)

Design decisions

  1. cbmem-based approach rather than serial console reading. The coreboot boot log is read via cbmem -1 after booting into Linux, which is the standard method used throughout the OSFV framework for reading coreboot logs (e.g., DMA protection tests, TPM tests, CBnT tests). This works on both real hardware and QEMU.

  2. Separate feature flag (BASE_PORT_LOG_CHECK_SUPPORT) rather than reusing existing BASE_PORT_* flags.

QEMU test results

Coreboot-Base-Port
CBP001.001 Boot into coreboot stage bootblock    | SKIP | (not enabled)
CBP002.001 Boot into coreboot stage romstage     | SKIP | (not enabled)
CBP003.001 Boot into coreboot stage postcar      | SKIP | (not enabled)
CBP004.001 Boot into coreboot stage ramstage     | SKIP | (not enabled)
CBP005.001 Resource allocator v4 - gathering     | SKIP | (not enabled)
CBP006.001 Resource allocator v4 - allocating    | SKIP | (not enabled)
CBP007.001 No ASSERTION ERROR in boot log        | PASS |
CBP008.001 No missing static PCI devices         | PASS |
CBP009.001 No resource allocation failures       | PASS |
CBP010.001 No BUG messages in boot log           | PASS |
CBP011.001 No devicetree.cb warnings             | PASS |

11 tests, 5 passed, 0 failed, 6 skipped

Open questions for maintainer

  1. Should CBP011 (devicetree.cb warnings / leftover static devices) be included? Per discussion in dasharo-issues#1409, this message is "present on almost all boards." It may be better as an informational/warning test rather than a hard failure. Happy to adjust.

  2. Are there additional error patterns beyond those in #1409 and #1364 that should be included? (e.g., from coreboot's review system or other ticket sources as mentioned in the issue checklist)

Add 5 new Robot Framework test cases to coreboot-base-port.robot that
check the coreboot boot log for common errors and warnings indicating
firmware misconfiguration during base port finalization.

Tests use cbmem -1 to read the coreboot console log after booting into
Linux, then assert absence of specific error patterns:

- CBP007: ASSERTION ERROR (missing PMC GPE routes, etc.)
- CBP008: Static PCI device not found (wrong devicetree.cb state)
- CBP009: Resource didn't fit (PCI resource allocation failure)
- CBP010: BUG: messages (hidden device requests, etc.)
- CBP011: Check your devicetree.cb (leftover static devices)

Gated by new BASE_PORT_LOG_CHECK_SUPPORT flag, enabled for QEMU.
All 5 tests pass on QEMU Q35 with Dasharo firmware v0.2.1.

Closes: Dasharo#921
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.

1 participant