diff options
| author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-08-12 08:37:28 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-16 09:25:00 +0100 |
| commit | 51d8e8fb370ae5eb9ebaff722c181a693a7f4ca1 (patch) | |
| tree | 41a1ff7e55a38ff88ae4a540482a4a36179211f9 | |
| parent | c0c463be28b731606f727ba85617c73796c05eab (diff) | |
| download | poky-51d8e8fb370ae5eb9ebaff722c181a693a7f4ca1.tar.gz | |
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]
(From OE-Core rev: 600f35c0873a61f8cd02c0e5cc1495ce7785ea89)
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>
| -rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 20 |
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: | |||
| 284 | stopread = False | 284 | stopread = False |
| 285 | endtime = time.time()+5 | 285 | endtime = time.time()+5 |
| 286 | while time.time()<endtime and not stopread: | 286 | while time.time()<endtime and not stopread: |
| 287 | sread, _, _ = select.select([self.server_socket],[],[],5) | 287 | sread, _, _ = select.select([self.server_socket],[],[],5) |
| 288 | for sock in sread: | 288 | for sock in sread: |
| 289 | answer = sock.recv(1024) | 289 | answer = sock.recv(1024) |
| 290 | if answer: | 290 | if answer: |
| 291 | data += answer | 291 | data += answer |
| 292 | else: | 292 | # Search the prompt to stop |
| 293 | sock.close() | 293 | if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): |
| 294 | stopread = True | 294 | stopread = True |
| 295 | break | ||
| 296 | else: | ||
| 297 | sock.close() | ||
| 298 | stopread = True | ||
| 295 | if data: | 299 | if data: |
| 296 | if raw: | 300 | if raw: |
| 297 | status = 1 | 301 | status = 1 |
