aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@codeaurora.org>2019-08-07 09:41:12 (GMT)
committerJouni Malinen <j@w1.fi>2019-08-07 09:57:22 (GMT)
commitd1fb06c9479b30c0aa0943ff330f8571167371c9 (patch)
treef54a47576f3bf841c0678d9854f942e68b373df3
parent12c5c2404e22235bddf5f3e71a25bc9c3e10e321 (diff)
downloadhostap-d1fb06c9479b30c0aa0943ff330f8571167371c9.zip
hostap-d1fb06c9479b30c0aa0943ff330f8571167371c9.tar.gz
hostap-d1fb06c9479b30c0aa0943ff330f8571167371c9.tar.bz2
tests: Check wait_event argument type
It was clearly too easy to get unexpected behavior by accidentially passing in a string instead of a list of strings to these functions, so enforce the correct type to notice such issues automatically. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
-rw-r--r--tests/hwsim/hostapd.py2
-rw-r--r--tests/hwsim/wpasupplicant.py4
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py
index a0b8cac..4430d80 100644
--- a/tests/hwsim/hostapd.py
+++ b/tests/hwsim/hostapd.py
@@ -246,6 +246,8 @@ class Hostapd:
logger.debug(self.dbg + ": " + ev)
def wait_event(self, events, timeout):
+ if not isinstance(events, list):
+ raise Exception("Hostapd.wait_event() called with incorrect events argument type")
start = os.times()[4]
while True:
while self.mon.pending():
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index be19637..8c7e13d 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -838,6 +838,8 @@ class WpaSupplicant:
raise Exception("P2P_CONNECT failed")
def _wait_event(self, mon, pfx, events, timeout):
+ if not isinstance(events, list):
+ raise Exception("WpaSupplicant._wait_event() called with incorrect events argument type")
start = os.times()[4]
while True:
while mon.pending():
@@ -864,6 +866,8 @@ class WpaSupplicant:
events, timeout)
def wait_group_event(self, events, timeout=10):
+ if not isinstance(events, list):
+ raise Exception("WpaSupplicant.wait_group_event() called with incorrect events argument type")
if self.group_ifname and self.group_ifname != self.ifname:
if self.gctrl_mon is None:
return None