diff options
| author | Simon Glass <[email protected]> | 2026-04-13 06:59:55 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-22 16:52:14 -0600 |
| commit | 55aa0c5acc4f6a0133b93bd3e91bf25367e14db7 (patch) | |
| tree | bb3f93433285cd829af9cd15a189c8775d0c6fdd | |
| parent | 875ebafe448b4ad665f131fd19fea07970af0027 (diff) | |
test: Add a check for a missing kernel
U-Boot should complain if the kernel is missing, so add a check for this
in test_fit_base()
Signed-off-by: Simon Glass <[email protected]>
| -rwxr-xr-x | test/py/tests/test_fit.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py index 4c7d400bc6a..9bfe25c0a51 100755 --- a/test/py/tests/test_fit.py +++ b/test/py/tests/test_fit.py @@ -70,7 +70,7 @@ base_its = ''' configurations { default = "conf-1"; conf-1 { - kernel = "kernel-1"; + %(kernel_config)s fdt = "fdt-1"; %(ramdisk_config)s %(loadables_config)s @@ -281,6 +281,7 @@ def test_fit_base(ubman): 'kernel_out' : kernel_out, 'kernel_addr' : 0x40000, 'kernel_size' : filesize(kernel), + 'kernel_config' : 'kernel = "kernel-1";', 'fdt' : fdt, 'fdt_out' : fdt_out, @@ -389,8 +390,16 @@ def test_fit_base(ubman): check_equal(kernel, kernel_out, 'Kernel not loaded') check_equal(fdt_data, fdt_out, 'FDT not loaded') check_not_equal(ramdisk, ramdisk_out, 'Ramdisk got decompressed?') - check_equal(ramdisk + '.gz', ramdisk_out, 'Ramdist not loaded') + check_equal(ramdisk + '.gz', ramdisk_out, 'Ramdisk not loaded') + # Try without a kernel + with ubman.log.section('No kernel + FDT'): + params['kernel_config'] = '' + params['ramdisk_config'] = '' + params['ramdisk_load'] = '' + fit = fit_util.make_fit(ubman, mkimage, base_its, params) + output = ubman.run_command_list(cmd.splitlines()) + assert "can't get kernel image!" in '\n'.join(output) mkimage = ubman.config.build_dir + '/tools/mkimage' run_fit_test(mkimage) |
