summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorJonas Karlman <[email protected]>2023-02-25 19:01:35 +0000
committerKever Yang <[email protected]>2023-02-28 18:07:26 +0800
commit40389c2a462256da7f2348bed791c8ba2ae6eec6 (patch)
treea274f32dbab50175590fab43afa39e6087d72045 /tools/binman/ftest.py
parent5fc5a840d4cf189616aba3a4a7bf10c4ac8edc83 (diff)
binman: Mark mkimage entry missing when its subnodes is missing
Using the mkimage entry with the multiple-data-files prop and having a missing external blob result in an unexpected ValueError exception using the --allow-missing flag. ValueError: Filename 'missing.bin' not found in input path (...) Fix this by using _pathname that is resolved by ObtainContents for blob entries, ObtainContents also handles allow missing for external blobs. Mark mkimage entry as missing and return without running mkimage when missing entries is reported by CheckMissing. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Kever Yang <[email protected]>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 48ac1540bfd..d74aa90a620 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6393,6 +6393,17 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
data = self._DoReadFile('277_rockchip_tpl.dts')
self.assertEqual(ROCKCHIP_TPL_DATA, data[:len(ROCKCHIP_TPL_DATA)])
+ def testMkimageMissingBlobMultiple(self):
+ """Test missing blob with mkimage entry and multiple-data-files"""
+ with test_util.capture_sys_output() as (stdout, stderr):
+ self._DoTestFile('278_mkimage_missing_multiple.dts', allow_missing=True)
+ err = stderr.getvalue()
+ self.assertIn("is missing external blobs and is non-functional", err)
+
+ with self.assertRaises(ValueError) as e:
+ self._DoTestFile('278_mkimage_missing_multiple.dts', allow_missing=False)
+ self.assertIn("not found in input path", str(e.exception))
+
if __name__ == "__main__":
unittest.main()