]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Report unexpected STATUS lines instead of stopping
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 4 Feb 2014 11:22:10 +0000 (13:22 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 4 Feb 2014 11:23:35 +0000 (13:23 +0200)
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>

tests/hwsim/wpasupplicant.py

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