tests: Report unexpected STATUS lines instead of stopping

It looks like get_status() has failed in some test runs because of a
STATUS command returning an line without '=' on it. Instead of stopping
there on exception, report the unexpected line in the log and ignore it
to allow test to continue.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2014-02-04 13:22:10 +02:00 committed by Jouni Malinen
parent ca5b81a5bb
commit e01929c668

View file

@ -241,8 +241,11 @@ class WpaSupplicant:
lines = res.splitlines() lines = res.splitlines()
vals = dict() vals = dict()
for l in lines: for l in lines:
try:
[name,value] = l.split('=', 1) [name,value] = l.split('=', 1)
vals[name] = value vals[name] = value
except ValueError, e:
logger.info(self.ifname + ": Ignore unexpected STATUS line: " + l)
return vals return vals
def get_status_field(self, field): def get_status_field(self, field):