summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-08-12 08:37:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-16 09:24:21 +0100
commit600f35c0873a61f8cd02c0e5cc1495ce7785ea89 (patch)
treefb3c7e315691980000e4824d06a620ca68c52765 /meta
parentb8ead7c0929c4096e50b481a608f5d0c09eab29d (diff)
downloadopenembedded-core-600f35c0873a61f8cd02c0e5cc1495ce7785ea89.tar.gz
openembedded-core-600f35c0873a61f8cd02c0e5cc1495ce7785ea89.tar.bz2
openembedded-core-600f35c0873a61f8cd02c0e5cc1495ce7785ea89.zip
qemurunner.py: Performance improvements in run_serial
This allow to search for the prompt after a command is run so it can avoid waiting for the timeout. Also corrected identation issues [YOCTO #8118] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 3e604d8155..04584474e7 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -284,14 +284,18 @@ class QemuRunner:
stopread = False
endtime = time.time()+5
while time.time()<endtime and not stopread:
- sread, _, _ = select.select([self.server_socket],[],[],5)
- for sock in sread:
- answer = sock.recv(1024)
- if answer:
- data += answer
- else:
- sock.close()
- stopread = True
+ sread, _, _ = select.select([self.server_socket],[],[],5)
+ for sock in sread:
+ answer = sock.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
+ else:
+ sock.close()
+ stopread = True
if data:
if raw:
status = 1