aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-26 17:40:16 -0600
committerSimon Glass <sjg@chromium.org>2020-10-29 14:42:59 -0600
commit63e7ba6c1820def06e7ba88ce357cb605285e70c (patch)
treee8a3e3bb89cf0ebc36299c683ce56fb52e6d722e /tools/binman/ftest.py
parent97c3e9a6faa4483a700b26988bc48c2f9efe8dd6 (diff)
downloadu-boot-63e7ba6c1820def06e7ba88ce357cb605285e70c.zip
u-boot-63e7ba6c1820def06e7ba88ce357cb605285e70c.tar.gz
u-boot-63e7ba6c1820def06e7ba88ce357cb605285e70c.tar.bz2
binman: Set section contents in GetData()
Section contents is not set up when ObtainContents() is called, since packing often changes the layout of the contents. Ensure that the contents are correctly recorded by making this function regenerate the section. It is normally only called by the parent section (when packing) or by the top-level image code, when writing out the image. So the performance impact is fairly small. Now that sections have their contents in their 'data' property, update testSkipAtStartSectionPad() to check it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 4c94bea..6f47dea 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -1822,6 +1822,8 @@ class TestFunctional(unittest.TestCase):
orig = self._decompress(entry.data)
self.assertEqual(orig, entry.uncomp_data)
+ self.assertEqual(image.data, entry.data)
+
expected = {
'blob:uncomp-size': len(COMPRESS_DATA),
'blob:size': len(data),
@@ -3890,7 +3892,7 @@ class TestFunctional(unittest.TestCase):
section = entries['section']
self.assertEqual(0, section.offset)
self.assertEqual(len(all), section.size)
- self.assertIsNone(section.data)
+ self.assertEqual(U_BOOT_DATA, section.data)
self.assertEqual(all, section.GetPaddedData())
entry = section.GetEntries()['u-boot']