test: spl: Add a test for the SPI load method

Add test for the SPI load method. This one is pretty straightforward. We
can't enable FIT_EXTERNAL with LOAD_FIT_FULL because spl_spi_load_image
doesn't know the total image size and has to guess from fdt_totalsize. This
doesn't include external data, so loading it will fail.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Sean Anderson
2023-10-14 16:48:05 -04:00
committed by Tom Rini
parent 65efaac425
commit 60d76e332d
8 changed files with 78 additions and 0 deletions

View File

@@ -5,6 +5,16 @@
import os.path
import pytest
@pytest.mark.buildconfigspec('spl_unit_test')
def test_ut_spl_init(u_boot_console):
"""Initialize data for ut spl tests."""
fn = u_boot_console.config.source_dir + '/spi.bin'
if not os.path.exists(fn):
data = b'\x00' * (2 * 1024 * 1024)
with open(fn, 'wb') as fh:
fh.write(data)
def test_spl(u_boot_console, ut_spl_subtest):
"""Execute a "ut" subtest.