diff mbox

hwsim tests: ignore status responses without =

Message ID 1417110174-743-1-git-send-email-johannes@sipsolutions.net
State Accepted
Headers show

Commit Message

Johannes Berg Nov. 27, 2014, 5:42 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

There are valid status (and possibly status-driver) responses
that don't have a name=value format, ignore those in the test
framework parser.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 tests/hwsim/wpasupplicant.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Nov. 29, 2014, 9:48 a.m. UTC | #1
On Thu, Nov 27, 2014 at 06:42:54PM +0100, Johannes Berg wrote:
> There are valid status (and possibly status-driver) responses
> that don't have a name=value format, ignore those in the test
> framework parser.

Thanks, applied.
diff mbox

Patch

diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index 8d0bb5b29f54..e4788ac36b5f 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -308,7 +308,11 @@  class WpaSupplicant:
         lines = res.splitlines()
         vals = dict()
         for l in lines:
-            [name,value] = l.split('=', 1)
+            try:
+                [name,value] = l.split('=', 1)
+            except ValueError:
+                logger.info(self.ifname + ": Ignore unexpected status line: " + l)
+                continue
             vals[name] = value
         return vals
 
@@ -323,7 +327,11 @@  class WpaSupplicant:
         lines = res.splitlines()
         vals = dict()
         for l in lines:
-            [name,value] = l.split('=', 1)
+            try:
+                [name,value] = l.split('=', 1)
+            except ValueError:
+                logger.info(self.ifname + ": Ignore unexpected status-driver line: " + l)
+                continue
             vals[name] = value
         return vals