aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-05-14 15:59:47 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-14 15:59:47 (GMT)
commit50d06776c6c638121e9630ef9cde7a477b04563d (patch)
treee68615bbeaa4172740769071adad8362045b2d33 /tests
parenta185e9b10b8dfbc21cffb99bda1e3e3ec32524ff (diff)
downloadhostap-50d06776c6c638121e9630ef9cde7a477b04563d.zip
hostap-50d06776c6c638121e9630ef9cde7a477b04563d.tar.gz
hostap-50d06776c6c638121e9630ef9cde7a477b04563d.tar.bz2
tests: Fix WEXT testing
Commit afb2e8b8913f131e5fb3a1031aacae3ab2b91287 ('tests: Store P2P Device ifname in class WpaSupplicant') did not take into account the possibility of capa.flags not existing in get_driver_status() and broke WEXT test cases. Fix this by checking that capa.flags is present before looking at its value. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/wpasupplicant.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index eba1bb0..f26124d 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -26,7 +26,7 @@ class WpaSupplicant:
if ifname:
self.set_ifname(ifname, hostname, port)
res = self.get_driver_status()
- if int(res['capa.flags'], 0) & 0x20000000:
+ if 'capa.flags' in res and int(res['capa.flags'], 0) & 0x20000000:
self.p2p_dev_ifname = 'p2p-dev-' + self.ifname
else:
self.p2p_dev_ifname = ifname
@@ -135,7 +135,7 @@ class WpaSupplicant:
port = self.get_ctrl_iface_port(ifname)
self.set_ifname(ifname, self.hostname, port)
res = self.get_driver_status()
- if int(res['capa.flags'], 0) & 0x20000000:
+ if 'capa.flags' in res and int(res['capa.flags'], 0) & 0x20000000:
self.p2p_dev_ifname = 'p2p-dev-' + self.ifname
else:
self.p2p_dev_ifname = ifname