diff mbox series

[U-Boot,v2,23/37] binman: Use the tools.Decompress method

Message ID 20190708191856.138863-24-sjg@chromium.org
State Accepted
Commit ff5c7e383e8c053684fff263dd0afc7aeb8040fb
Delegated to: Simon Glass
Headers show
Series binman: Add CBFS support | expand

Commit Message

Simon Glass July 8, 2019, 7:18 p.m. UTC
Update the compression test to use the tools module to decompress the
output data.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 tools/binman/ftest.py | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Comments

Simon Glass July 18, 2019, 1:59 a.m. UTC | #1
Update the compression test to use the tools module to decompress the
output data.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 tools/binman/ftest.py | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index c74e12d13c8..6ff871b3c16 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -59,7 +59,7 @@  BMPBLK_DATA           = b'bmp'
 VBLOCK_DATA           = b'vblk'
 FILES_DATA            = (b"sorry I'm late\nOh, don't bother apologising, I'm " +
                          b"sorry you're alive\n")
-COMPRESS_DATA         = b'data to compress'
+COMPRESS_DATA         = b'compress xxxxxxxxxxxxxxxxxxxxxx data'
 REFCODE_DATA          = b'refcode'
 
 
@@ -1560,16 +1560,7 @@  class TestFunctional(unittest.TestCase):
             self._ResetDtbs()
 
     def _decompress(self, data):
-        out = os.path.join(self._indir, 'lz4.tmp')
-        with open(out, 'wb') as fd:
-            fd.write(data)
-        return tools.Run('lz4', '-dc', out, binary=True)
-        '''
-        try:
-            orig = lz4.frame.decompress(data)
-        except AttributeError:
-            orig = lz4.decompress(data)
-        '''
+        return tools.Decompress(data, 'lz4')
 
     def testCompress(self):
         """Test compression of blobs"""