aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass2020-10-26 17:40:15 -0600
committerSimon Glass2020-10-29 14:42:59 -0600
commit97c3e9a6faa4483a700b26988bc48c2f9efe8dd6 (patch)
tree031a9234c43728c3628b56dd8d890fbca0ca1d5e /tools/binman/ftest.py
parent7d398bb1c71580da2182f0b820d91950bf4b3d24 (diff)
binman: Store the original data before compression
When compressing an entry, the original uncompressed data is overwritten. Store it so it is available if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 830b610890f..4c94bea6f00 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -1810,6 +1810,18 @@ class TestFunctional(unittest.TestCase):
props = self._GetPropTree(dtb, ['size', 'uncomp-size'])
orig = self._decompress(data)
self.assertEquals(COMPRESS_DATA, orig)
+
+ # Do a sanity check on various fields
+ image = control.images['image']
+ entries = image.GetEntries()
+ self.assertEqual(1, len(entries))
+
+ entry = entries['blob']
+ self.assertEqual(COMPRESS_DATA, entry.uncomp_data)
+ self.assertEqual(len(COMPRESS_DATA), entry.uncomp_size)
+ orig = self._decompress(entry.data)
+ self.assertEqual(orig, entry.uncomp_data)
+
expected = {
'blob:uncomp-size': len(COMPRESS_DATA),
'blob:size': len(data),