1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-11 13:06:53 +02:00

binman: Support missing compression tools

Handle missing compression tools by returning empty data and record
missing bintool.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Stefan Herbrechtsmeier
2022-08-19 16:25:31 +02:00
committed by Simon Glass
parent ec7d27d3a8
commit c3665a896e
3 changed files with 29 additions and 3 deletions

View File

@@ -105,6 +105,15 @@ class TestEntry(unittest.TestCase):
self.assertTrue(isinstance(ent, Entry_blob))
self.assertEquals('missing', ent.etype)
def testDecompressData(self):
"""Test the DecompressData() method of the base class"""
base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb')
base.compress = 'lz4'
bintools = {}
base.comp_bintool = base.AddBintool(bintools, '_testing')
self.assertEquals(tools.get_bytes(0, 1024), base.CompressData(b'abc'))
self.assertEquals(tools.get_bytes(0, 1024), base.DecompressData(b'abc'))
if __name__ == "__main__":
unittest.main()