diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/core/case.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/case.py b/meta/lib/oeqa/core/case.py index 180635ac6c..aae451fef2 100644 --- a/meta/lib/oeqa/core/case.py +++ b/meta/lib/oeqa/core/case.py | |||
@@ -59,7 +59,7 @@ class OEPTestResultTestCase: | |||
59 | """ | 59 | """ |
60 | @staticmethod | 60 | @staticmethod |
61 | def _compress_log(log): | 61 | def _compress_log(log): |
62 | logdata = log.encode("utf-8") | 62 | logdata = log.encode("utf-8") if isinstance(log, str) else log |
63 | logdata = zlib.compress(logdata) | 63 | logdata = zlib.compress(logdata) |
64 | logdata = base64.b64encode(logdata).decode("utf-8") | 64 | logdata = base64.b64encode(logdata).decode("utf-8") |
65 | return {"compressed" : logdata} | 65 | return {"compressed" : logdata} |
@@ -80,7 +80,7 @@ class OEPTestResultTestCase: | |||
80 | if log is not None: | 80 | if log is not None: |
81 | sections[section]["log"] = self._compress_log(log) | 81 | sections[section]["log"] = self._compress_log(log) |
82 | elif logfile is not None: | 82 | elif logfile is not None: |
83 | with open(logfile, "r") as f: | 83 | with open(logfile, "rb") as f: |
84 | sections[section]["log"] = self._compress_log(f.read()) | 84 | sections[section]["log"] = self._compress_log(f.read()) |
85 | 85 | ||
86 | if duration is not None: | 86 | if duration is not None: |