diff options
author | Simon Glass <sjg@chromium.org> | 2022-08-13 11:40:48 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-08-20 18:07:32 -0600 |
commit | dfe1db4030edd11275e0c9f8fa020b12ecf90d8c (patch) | |
tree | f7109f866c3942af054693cd2ef461cc9a7cbd7d /tools/binman/ftest.py | |
parent | e9b5e31a12b9a459ca4c35161851674aba84f9af (diff) |
binman: Allow the image name to be the data file
Some image types use the -n parameter to pass in the data file. Add
support for this, with a new property.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r-- | tools/binman/ftest.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index ac54183c399..e88eedff51b 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -5722,6 +5722,23 @@ fdt fdtmap Extract the devicetree blob from the fdtmap "Node '/section': Replacing sections is not implemented yet", str(exc.exception)) + def testMkimageImagename(self): + """Test using mkimage with -n holding the data too""" + data = self._DoReadFile('235_mkimage_name.dts') + + # Check that the data appears in the file somewhere + self.assertIn(U_BOOT_SPL_DATA, data) + + # Get struct image_header -> ih_name + name = data[0x20:0x40] + + # Build the filename that we expect to be placed in there, by virtue of + # the -n paraameter + expect = os.path.join(tools.get_output_dir(), 'mkimage.mkimage') + + # Check that the image name is set to the temporary filename used + self.assertEqual(expect.encode('utf-8')[:0x20], name) + if __name__ == "__main__": unittest.main() |