diff options
Diffstat (limited to 'meta/lib/oeqa/utils/qemutinyrunner.py')
-rw-r--r-- | meta/lib/oeqa/utils/qemutinyrunner.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/lib/oeqa/utils/qemutinyrunner.py b/meta/lib/oeqa/utils/qemutinyrunner.py index ec52473834..b1009a0a37 100644 --- a/meta/lib/oeqa/utils/qemutinyrunner.py +++ b/meta/lib/oeqa/utils/qemutinyrunner.py | |||
@@ -107,14 +107,14 @@ class QemuTinyRunner(QemuRunner): | |||
107 | 107 | ||
108 | return self.is_alive() | 108 | return self.is_alive() |
109 | 109 | ||
110 | def run_serial(self, command): | 110 | def run_serial(self, command, timeout=5): |
111 | self.server_socket.sendall(command+'\n') | 111 | self.server_socket.sendall(command+'\n') |
112 | data = '' | 112 | data = '' |
113 | status = 0 | 113 | status = 0 |
114 | stopread = False | 114 | stopread = False |
115 | endtime = time.time()+5 | 115 | endtime = time.time()+timeout |
116 | while time.time()<endtime and not stopread: | 116 | while time.time()<endtime and not stopread: |
117 | sread, _, _ = select.select([self.server_socket],[],[],5) | 117 | sread, _, _ = select.select([self.server_socket],[],[],1) |
118 | for sock in sread: | 118 | for sock in sread: |
119 | answer = sock.recv(1024) | 119 | answer = sock.recv(1024) |
120 | if answer: | 120 | if answer: |
@@ -124,6 +124,8 @@ class QemuTinyRunner(QemuRunner): | |||
124 | stopread = True | 124 | stopread = True |
125 | if not data: | 125 | if not data: |
126 | status = 1 | 126 | status = 1 |
127 | if not stopread: | ||
128 | data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout | ||
127 | return (status, str(data)) | 129 | return (status, str(data)) |
128 | 130 | ||
129 | def find_child(self,parent_pid): | 131 | def find_child(self,parent_pid): |