summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-04 13:20:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-04 23:05:54 +0100
commit2305928a00fe4d7b65a06b68156297de051101c6 (patch)
treeb8316e2c3a9f49f1408a85ffe06b05a68490bd95 /meta/lib/oeqa/utils/qemurunner.py
parent141707c2326de034a39c516d96a94f3874c81cb8 (diff)
downloadpoky-2305928a00fe4d7b65a06b68156297de051101c6.tar.gz
qemurunner: Skip conversion from/to binary data for logfile
There is no point in decoding binary data only to encode it again risking conversion issues. Write the raw data to the log file as binary and skip the conversion. Also always update self.msg even if a logfile isn't specified to improve logging/debug. (From OE-Core rev: b5d67471dddd198723c4f711747783a33e8e5987) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 22cf258ddd..b8f5111286 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -115,10 +115,9 @@ class QemuRunner:
115 115
116 def log(self, msg): 116 def log(self, msg):
117 if self.logfile: 117 if self.logfile:
118 msg = self.decode_qemulog(msg) 118 with codecs.open(self.logfile, "ab") as f:
119 self.msg += msg 119 f.write(msg)
120 with codecs.open(self.logfile, "a", encoding="utf-8") as f: 120 self.msg += self.decode_qemulog(msg)
121 f.write("%s" % msg)
122 121
123 def getOutput(self, o): 122 def getOutput(self, o):
124 import fcntl 123 import fcntl