aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-11-23 21:09:52 -0700
committerSimon Glass <sjg@chromium.org>2021-12-05 09:23:15 -0700
commitcc2c50042690151b1b31d9b6d0f1a9dc5831ee5f (patch)
tree2595256751d08dca6d4e5a3144f42a1eae2e3230 /tools/binman/ftest.py
parent1b5a5331f3c7ad3ae5688841a7a6e710a2cb4dc7 (diff)
binman: Support lists of external blobs
Sometimes it is useful to have a list of related external blobs in a single entry. An example is the DDR binaries used by meson. There are 9 files in total. Add support for this, so we don't have to have a separate entry for each. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index d3a6cbf71d..f5ceb9fb17 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -4715,6 +4715,26 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
finally:
shutil.rmtree(tmpdir)
+ def testExtblobList(self):
+ """Test an image with an external blob list"""
+ data = self._DoReadFile('215_blob_ext_list.dts')
+ self.assertEqual(REFCODE_DATA + FSP_M_DATA, data)
+
+ def testExtblobListMissing(self):
+ """Test an image with a missing external blob"""
+ with self.assertRaises(ValueError) as e:
+ self._DoReadFile('216_blob_ext_list_missing.dts')
+ self.assertIn("Filename 'missing-file' not found in input path",
+ str(e.exception))
+
+ def testExtblobListMissingOk(self):
+ """Test an image with an missing external blob that is allowed"""
+ with test_util.capture_sys_output() as (stdout, stderr):
+ self._DoTestFile('216_blob_ext_list_missing.dts',
+ allow_missing=True)
+ err = stderr.getvalue()
+ self.assertRegex(err, "Image 'main-section'.*missing.*: blob-ext")
+
if __name__ == "__main__":
unittest.main()