summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorHeiko Thiery <heiko.thiery@gmail.com>2022-01-06 11:49:41 +0100
committerTom Rini <trini@konsulko.com>2022-01-07 12:10:55 -0500
commita89c8f2111bc647b697b776a40227673cfc713e3 (patch)
treee5169f24b432600613ff2dc1d4a78d5955627cb6 /tools/binman/ftest.py
parenta14af7216a220fe8f1b2a5308ed632abe6f9f97f (diff)
binman: add support for creating dummy files for external blobs
While converting to binman for an imx8mq board, it has been found that building in the u-boot CI fails. This is because an imx8mq requires an external binary (signed_hdmi_imx8m.bin). If this file cannot be found mkimage fails. To be able to build this board in the u-boot CI a binman option (--fake-ext-blobs) is introduced that can be switched on via the u-boot makefile option BINMAN_FAKE_EXT_BLOBS. With that the needed dummy files are created. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 6be003786e8..2a98d810288 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -308,7 +308,7 @@ class TestFunctional(unittest.TestCase):
def _DoTestFile(self, fname, debug=False, map=False, update_dtb=False,
entry_args=None, images=None, use_real_dtb=False,
use_expanded=False, verbosity=None, allow_missing=False,
- extra_indirs=None, threads=None,
+ allow_fake_blobs=False, extra_indirs=None, threads=None,
test_section_timeout=False, update_fdt_in_elf=None):
"""Run binman with a given test file
@@ -331,6 +331,7 @@ class TestFunctional(unittest.TestCase):
verbosity: Verbosity level to use (0-3, None=don't set it)
allow_missing: Set the '--allow-missing' flag so that missing
external binaries just produce a warning instead of an error
+ allow_fake_blobs: Set the '--fake-ext-blobs' flag
extra_indirs: Extra input directories to add using -I
threads: Number of threads to use (None for default, 0 for
single-threaded)
@@ -369,6 +370,8 @@ class TestFunctional(unittest.TestCase):
args.append('-a%s=%s' % (arg, value))
if allow_missing:
args.append('-M')
+ if allow_fake_blobs:
+ args.append('--fake-ext-blobs')
if update_fdt_in_elf:
args += ['--update-fdt-in-elf', update_fdt_in_elf]
if images:
@@ -4661,6 +4664,16 @@ class TestFunctional(unittest.TestCase):
str(e.exception),
"Not enough space in '.*u_boot_binman_embed_sm' for data length.*")
+ def testFakeBlob(self):
+ """Test handling of faking an external blob"""
+ with test_util.capture_sys_output() as (stdout, stderr):
+ self._DoTestFile('203_fake_blob.dts', allow_missing=True,
+ allow_fake_blobs=True)
+ err = stderr.getvalue()
+ self.assertRegex(err,
+ "Image '.*' has faked external blobs and is non-functional: .*")
+ os.remove('binman_faking_test_blob')
+
if __name__ == "__main__":
unittest.main()