From c3665a896e30578f8e5d6f1927da304efcd14735 Mon Sep 17 00:00:00 2001 From: Stefan Herbrechtsmeier Date: Fri, 19 Aug 2022 16:25:31 +0200 Subject: binman: Support missing compression tools Handle missing compression tools by returning empty data and record missing bintool. Signed-off-by: Stefan Herbrechtsmeier Reviewed-by: Simon Glass --- tools/binman/entry_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/binman/entry_test.py') diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py index 1d60076be1..aa470c5816 100644 --- a/tools/binman/entry_test.py +++ b/tools/binman/entry_test.py @@ -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() -- cgit v1.2.3