summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-16 18:40:39 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:01 +0100
commit63404baadbfd1225bbb955f8c8f817073aef65d8 (patch)
treeeb1f3060a7e8e814bf409079c442d797d0c80500 /meta/lib/oeqa/utils/qemurunner.py
parentaa10d71aeed6647a8a979040e4c2b2210bac4334 (diff)
downloadpoky-63404baadbfd1225bbb955f8c8f817073aef65d8.tar.gz
qemurunner: convert data when working with socket
Converted str to bytes before sending to socket. Converted bytes to str after receiving from socket. This should fix TypeError: 'str' does not support the buffer interface for qemurunner.run_serial method. (From OE-Core rev: 210e290c9251839dc74e3aabdcea3655dd707a50) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> 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.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c1d07d9b41..3d60433cae 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -376,14 +376,14 @@ class QemuRunner:
376 376
377 data = '' 377 data = ''
378 status = 0 378 status = 0
379 self.server_socket.sendall(command) 379 self.server_socket.sendall(command.encode('utf-8'))
380 keepreading = True 380 keepreading = True
381 while keepreading: 381 while keepreading:
382 sread, _, _ = select.select([self.server_socket],[],[],5) 382 sread, _, _ = select.select([self.server_socket],[],[],5)
383 if sread: 383 if sread:
384 answer = self.server_socket.recv(1024) 384 answer = self.server_socket.recv(1024)
385 if answer: 385 if answer:
386 data += answer 386 data += answer.decode('utf-8')
387 # Search the prompt to stop 387 # Search the prompt to stop
388 if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): 388 if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
389 keepreading = False 389 keepreading = False