summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-11-05 09:08:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:39:36 +0000
commit3b95964bc1cb63c1b78249fd8f8c2d5d5fb2c288 (patch)
tree9beedeb82240fbaed6a914a0c9fb34047cc27ff2 /meta/lib/oeqa/utils
parentbbd6d07c98149201a51086da9a069d207c4777d5 (diff)
downloadpoky-3b95964bc1cb63c1b78249fd8f8c2d5d5fb2c288.tar.gz
qemurunner: Remove the timeout in run_serial
Sometmes when there is high load in the server the commands executed in the target take a lot of time to complete and this lead to incorrect dump files or empty files. This is caused because run_serial has a timeout of five seconds when running the commands in the target. This change removes the timeout and just keep reading the socket until it finds the prompt from the target or when the socket is not ready to be read. [YOCTO #8510] (From OE-Core rev: d1a97475b4e6c7066a3161cb9cec1d4b27644518) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index abbafd51e4..e1c8ea1085 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -366,23 +366,25 @@ class QemuRunner:
366 # We assume target system have echo to get command status 366 # We assume target system have echo to get command status
367 if not raw: 367 if not raw:
368 command = "%s; echo $?\n" % command 368 command = "%s; echo $?\n" % command
369 self.server_socket.sendall(command) 369
370 data = '' 370 data = ''
371 status = 0 371 status = 0
372 stopread = False 372 self.server_socket.sendall(command)
373 endtime = time.time()+5 373 keepreading = True
374 while time.time()<endtime and not stopread: 374 while keepreading:
375 sread, _, _ = select.select([self.server_socket],[],[],5) 375 sread, _, _ = select.select([self.server_socket],[],[],5)
376 for sock in sread: 376 if sread:
377 answer = sock.recv(1024) 377 answer = self.server_socket.recv(1024)
378 if answer: 378 if answer:
379 data += answer 379 data += answer
380 # Search the prompt to stop 380 # Search the prompt to stop
381 if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): 381 if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
382 stopread = True 382 keepreading = False
383 break
384 else: 383 else:
385 raise Exception("No data on serial console socket") 384 raise Exception("No data on serial console socket")
385 else:
386 keepreading = False
387
386 if data: 388 if data:
387 if raw: 389 if raw:
388 status = 1 390 status = 1