wolfBoot/tools/unit-tests
Daniele Lacamera edf41b1c35 Verify partition isolation in custom-trailer state test
After writing both partitions, re-read BOOT and confirm it still
holds TESTING, so a backend that routes both IDs to the same
trailer is caught (previously each read followed its own write).

Verification: make -C tools/unit-tests unit-custom-trailer-nopart
exits 0; suite runs 1 check, 0 failures.
2026-09-17 09:29:03 +02:00
..
cc26x2_ti_stub tests: cover cc26x2 flash error propagation 2026-08-17 15:59:35 +02:00
mcxa_fsl_stub
Makefile PR 892: address 3 Fenrir review findings 2026-09-16 17:19:16 +02:00
README.md
arm_cmse.h
gpt-sfdisk-test.h
target.h
txt_filler.h
unit-ahci-unlock-panic.c
unit-arm-tee-psa-ipc.c
unit-ata-security-passphrase-zeroize.c F-6764: scrub passphrase buffer when async ATA command completes 2026-09-15 15:43:11 +02:00
unit-aurix-erased-fill.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-boot-x86_fsp.c
unit-cm4-rauc-slot.c Fixes from skoll review findings 2026-08-24 12:47:34 +02:00
unit-cm4-sdhci.c cm4: add wolfCrypt FIPS 140-3 support + CI, SDHCI unit test, review fixes 2026-08-24 12:47:34 +02:00
unit-common.c
unit-custom-trailer-nopart.c Verify partition isolation in custom-trailer state test 2026-09-17 09:29:03 +02:00
unit-delta-sector-align.py F-6878: delta: reject non-multiple SECTOR_SIZE/DELTA_BLOCK_SIZE at build 2026-09-04 09:46:27 +02:00
unit-delta.c
unit-diagnostics.c
unit-dice-token-size.c Add wolfCOSE DICE attestation 2026-08-06 09:44:52 +02:00
unit-disk.c Add T1040 eSDHC SD card disk boot support, first big-endian disk-boot target 2026-09-10 08:15:48 +02:00
unit-ecc-raw-der.c F-11024: pass full-width fields to wc_ecc_rs_raw_to_sig in the wolfHSM verify path 2026-08-25 08:50:42 +02:00
unit-efi-x86-open-image.c F-9746: x86_64_efi: fix do_boot prototype mismatch, drop unused param 2026-09-04 10:57:08 +02:00
unit-elf-bss-guard.c
unit-elf-entry-inplace.c elf: read the ELF entry point before loading segments over it 2026-08-25 08:46:40 +02:00
unit-elf-mmu-fail.c F-11027: abort the ELF load when an mmu_cb mapping fails 2026-08-25 08:51:09 +02:00
unit-elf-scatter-db-build.py Address minor PR 882 review nits 2026-09-04 16:39:26 +02:00
unit-enc-nvm.c
unit-ext4.c ext4: add read-only extent-based ext4 filesystem support 2026-09-02 10:47:33 +02:00
unit-extflash.c add unaligned fallback-IV RMW test for ext_flash_encrypt_write 2026-08-21 09:03:18 +02:00
unit-fat32.c disk_fs: add read-only FAT32 filesystem support for disk boot 2026-09-02 10:47:33 +02:00
unit-fdt-memrsv-wrap.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-fdt.c versal: report EL2 exceptions, fix FIT ramdisk fixup and the EL2->EL1 cache handoff 2026-09-10 08:17:21 +02:00
unit-fit-fpga.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-fit-gzip.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-flash-erase-c0.c
unit-flash-erase-g0.c
unit-flash-erase-h7.c
unit-flash-erase-l0.c
unit-flash-erase-mcxw.c mcxw: extend the erase length when rounding the start down 2026-08-12 13:21:08 +02:00
unit-flash-erase-u3.c
unit-flash-erase-wb.c
unit-flash-m2354.c Add Nuvoton NuMaker M2354 Cortex-M23 target with TrustZone 2026-09-14 18:08:40 +02:00
unit-flash-write-cc26x2.c Remove tracker ids from code, condense comments 2026-08-18 19:48:12 +02:00
unit-flash-write-mcxa.c
unit-flash-write-nrf52.c nrf52/nrf5340/stm32l0: fix the 32-bit fast path in hal_flash_write 2026-08-12 13:20:56 +02:00
unit-flash-write-same51.c
unit-flash-write-samr21.c
unit-fs-malicious.c ext4: add read-only extent-based ext4 filesystem support 2026-09-02 10:47:33 +02:00
unit-fs-probe.c disk_fs: add read-only FAT32 filesystem support for disk boot 2026-09-02 10:47:33 +02:00
unit-fwtpm-cmd-toctou.c F-11044: stage the fwTPM command in secure memory before processing 2026-08-25 08:51:09 +02:00
unit-fwtpm-nv-oob.c
unit-fwtpm-rsp-overrun.c Address Copilot review: test guard hygiene and clean list 2026-08-25 08:51:10 +02:00
unit-fwtpm-stub.c
unit-gzip.c
unit-hifive1-flash-write.c Address Copilot review: test guard hygiene and clean list 2026-08-25 08:51:10 +02:00
unit-image-elf-scatter.c F-11047: image: drop incorrect boot-partition destination check 2026-09-04 15:52:19 +02:00
unit-image-wolfhsm-client-build.py Address minor PR 882 review nits 2026-09-04 16:39:26 +02:00
unit-image.c F-12108: image: clamp sha block/peek to fw_size 2026-09-04 13:40:37 +02:00
unit-imx-rt-cache-align.c
unit-keygen-xmss-params.c PR 892: P1021 NAND status bits + test coverage for F-12883/F-12922 2026-09-16 14:40:42 +02:00
unit-keystore.c
unit-kontron-tgl-spi.c F-12104: kontron tgl: correct the SPIBAR FREG/FPR register offsets 2026-09-02 12:15:51 +02:00
unit-linux-loader-e820.c
unit-linux-loader-syssize.c
unit-loader-tpm-init.c
unit-ls1028a-xspi-write.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-max-space.c
unit-mock-flash.c PR 892: P1021 NAND status bits + test coverage for F-12883/F-12922 2026-09-16 14:40:42 +02:00
unit-mock-state.c
unit-mpusize.c
unit-multiboot.c F-12060: multiboot2: terminate the boot info tag list with an end tag 2026-09-02 12:15:51 +02:00
unit-nvm-cache-scrub.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-nvm.c
unit-otp-keystore-gen-zeroize.c
unit-otp-keystore.c
unit-p1021-erase-advance.c Fix DQ0 wording in p1021 erase-fail test comment 2026-09-16 19:53:59 +02:00
unit-p1021-fcm-bytes.c PR 892: address 3 Fenrir review findings 2026-09-16 17:19:16 +02:00
unit-p1021-qe-firmware.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-p1021-read-badblock.c F-12064: p1021: drop already-delivered pages of a bad block 2026-09-02 13:17:48 +02:00
unit-parser-large-header.c F-6762: compare the TLV field budget in a 32-bit domain 2026-08-21 08:52:59 +02:00
unit-parser.c
unit-pci.c F-12066: pci: restore original COMMAND and clear windows on bridge error 2026-09-02 12:15:51 +02:00
unit-pic32-pfswap.c
unit-pkcs11-nsc-zeroize.c F-12107: pkcs11 nsc: zero work buffer before it can be freed 2026-09-04 14:53:15 +02:00
unit-pkcs11-pin-zeroize.c F-12942: pkcs11: wipe PIN on terminal init failure 2026-09-15 13:24:14 +02:00
unit-pkcs11_store.c pkcs11 store: cover torn flash ops and require a present, truncated header 2026-09-10 21:39:18 +02:00
unit-policy-create.c
unit-policy-sign.c
unit-psa_store.c F-12921: erase keyvault payload on object removal 2026-09-07 14:36:29 +02:00
unit-qspi-flash.c F-7382: clip QSPI page program transfers at the device page boundary 2026-08-11 12:54:36 +02:00
unit-rot-auth.c
unit-rp2350-flash-write.c F-12061: unit test: keep the XIP fast-path source in the flash model 2026-09-02 12:15:52 +02:00
unit-sama5d3-ext-read.c bad-blocks: keep skipping cumulative 2026-08-24 12:38:47 +02:00
unit-samr21-erase-advance.c samr21: advance flash erase by the 256-byte row size 2026-08-26 18:55:05 +02:00
unit-sdhci-acmd41-timeout.c F-11032: bound the ACMD41 OCR readiness poll in SD card init 2026-08-26 17:41:22 +02:00
unit-sdhci-disk-unaligned.c Peer review fixes (thanks Jack) 2026-08-24 12:47:34 +02:00
unit-sdhci-dma-error.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-sdhci-response-bits.c
unit-sdhci-uhs-recover.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-sdhci-wait-busy.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-sectorflags.c
unit-sign-custom-tlv-large.py
unit-sign-custom-tlv-le.py
unit-sign-custom-tlv-pubkey-der.py
unit-sign-delta-basehash-cleanup.py F-8006: return errors from delta base-hash validation in sign tool 2026-08-11 09:13:31 +02:00
unit-sign-delta-cert-inv-off.py
unit-sign-delta-tlv.py
unit-sign-dts.py fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-sign-encrypted-output.c
unit-sign-encrypted-output.mkfrag
unit-sign-header-failure.c
unit-sign-hybrid-keyload.c F-8003: separate decoded key objects for hybrid signers 2026-08-11 09:25:54 +02:00
unit-spi-flash.c
unit-stm32c0-write.c F-12870: STM32C0: program flash writes through absolute addresses 2026-09-07 16:05:51 +02:00
unit-stm32g4-write.c F-11023: require a full double word in the STM32 fast write paths 2026-08-25 08:50:42 +02:00
unit-stm32l4-write.c F-12062: STM32L4: require a full double word in the fast write path 2026-09-02 12:15:51 +02:00
unit-stm32l5-write.c Address Fenrir PR review: make program-window observable in l5/u5 write tests 2026-09-07 19:19:22 +02:00
unit-stm32u5-write.c Address Fenrir PR review: make program-window observable in l5/u5 write tests 2026-09-07 19:19:22 +02:00
unit-stm32wb-write.c F-12063: STM32WB: require a full double word in the fast write path 2026-09-02 12:15:51 +02:00
unit-store-sbrk.c
unit-string.c
unit-t10xx-dts-memac.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-t10xx-flash-status.c F-11033: propagate program/erase timeouts from the T10xx flash HAL 2026-08-25 08:51:09 +02:00
unit-t10xx-qe-firmware.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-t2080-fman-loader.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-ti-hercules-write.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-tpm-advio-zeroize.c F-8007: wipe TPM advanced-IO staging buffers in TPM2_IoCb() 2026-08-11 12:23:09 +02:00
unit-tpm-api-names.c
unit-tpm-blob.c
unit-tpm-check-rot-auth.c
unit-tpm-mfgid-eh-zeroize.c F-7069: clear the EH authValue from the stack in wolfBoot_tpm2_get_timestamp 2026-08-11 12:59:01 +02:00
unit-tpm-nsc-cert.c
unit-tpm-rsa-exp.c F-12105: tpm: keep keystore size as int in load_pubkey 2026-09-04 14:06:33 +02:00
unit-uart-flash.c
unit-ubootenv.c Peer review fixes (thanks Daniele) 2026-08-24 12:47:34 +02:00
unit-update-disk-fit.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-update-disk-fs.c unit test: match wolfBoot_get_dts_size mock to the 2-arg signature 2026-09-02 12:19:13 +02:00
unit-update-disk-fsp.c F-12873: update_disk: FSP low-mem check reuses validated slot_max 2026-09-07 14:40:35 +02:00
unit-update-disk-oob.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-update-disk.c fdt: rewrite device tree parser with capacity bound and full validation 2026-09-02 10:48:52 +02:00
unit-update-flash-hwswap.c
unit-update-flash.c F-7067: elf scatter: fix PART_IS_EXT arg and check load result 2026-09-04 09:52:22 +02:00
unit-update-ram-custom-trailer.c PR 892: address 6 Fenrir review findings 2026-09-16 16:18:49 +02:00
unit-update-ram-enc.c
unit-update-ram-nofixed-noramboot.c PR 892: address 6 Fenrir review findings 2026-09-16 16:18:49 +02:00
unit-update-ram-nofixed.c
unit-update-ram-noramboot.c PR 892: P1021 NAND status bits + test coverage for F-12883/F-12922 2026-09-16 14:40:42 +02:00
unit-update-ram-uboot.c F-7985: enter legacy uImage at ih_ep when it differs from ih_load 2026-08-11 12:16:39 +02:00
unit-update-ram.c F-12922: do not block fallback to a valid image in wolfBoot_start 2026-09-15 08:24:11 +02:00
unit-update-trigger-scrub.c unit-tests: pin the update-trigger scrub payload and ordering 2026-08-26 20:10:47 +02:00
unit-va416x0-fram.c F-7051: return the hal_status_t unmodified from FRAM_Erase 2026-08-18 03:32:21 +02:00
unit-versal-ext-write.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-versal-qspi-dma.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-wolfhsm_flash_hal.c
unit-x86-fsp-stage1auth-build.py Address minor PR 882 review nits 2026-09-04 16:39:26 +02:00
unit-x86-paging-oob.c
unit-xspi-tfd-index.c
unit-zynq-erase-loop.c Condense the verbose comments 2026-08-18 20:12:06 +02:00
unit-zynq-ext-write.c Condense the verbose comments 2026-08-18 20:12:06 +02:00

README.md

Unit Test Tools

This uses the "check" unit test framework for C.

You may need to run "apt install check", "yum install check" or "brew install check".

Building

Use make to build.

Expected output

$ ./unit-parser
Running suite(s): wolfBoot
Explicit end of options reached
This field is too large (bigger than the space available in the current header)
This field is too large and would overflow the image header
Illegal address (too high)
Illegal address (too high)
100%: Checks: 2, Failures: 0, Errors: 0