From 6bb9d861f970b4d818997351b8cab778ef19ca25 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Thu, 27 Nov 2014 18:42:54 +0100 Subject: [PATCH] tests: Ignore status responses without = 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 --- tests/hwsim/wpasupplicant.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 8d0bb5b29..e4788ac36 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