diff options
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 2f3ec69709..a9b7880f36 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -311,7 +311,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 @@ -334,6 +334,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) @@ -372,6 +373,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: @@ -4664,6 +4667,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') + def testVersion(self): """Test we can get the binman version""" version = '(unreleased)' @@ -4952,6 +4965,5 @@ fdt fdtmap Extract the devicetree blob from the fdtmap # There should be a U-Boot after the final FIP self.assertEqual(U_BOOT_DATA, data[-4:]) - if __name__ == "__main__": unittest.main() |