[OE-core] [PATCH 1/1] qemurunner: Remove the timeout in run_serial
mariano.lopez at linux.intel.com
mariano.lopez at linux.intel.com
Thu Nov 5 09:08:58 UTC 2015
From: Mariano Lopez <mariano.lopez at linux.intel.com>
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]
Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
---
meta/lib/oeqa/utils/qemurunner.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index bdc6e0a..e1e4057 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -366,23 +366,25 @@ class QemuRunner:
# We assume target system have echo to get command status
if not raw:
command = "%s; echo $?\n" % command
- self.server_socket.sendall(command)
+
data = ''
status = 0
- stopread = False
- endtime = time.time()+5
- while time.time()<endtime and not stopread:
+ self.server_socket.sendall(command)
+ keepreading = True
+ while keepreading:
sread, _, _ = select.select([self.server_socket],[],[],5)
- for sock in sread:
- answer = sock.recv(1024)
+ if sread:
+ answer = self.server_socket.recv(1024)
if answer:
data += answer
# Search the prompt to stop
if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
- stopread = True
- break
+ keepreading = False
else:
raise Exception("No data on serial console socket")
+ else:
+ keepreading = False
+
if data:
if raw:
status = 1
--
1.8.4.5
More information about the Openembedded-core
mailing list