aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-12-12 19:02:49 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-12 19:02:49 (GMT)
commitf0df5afa08fe511a008f6526cb9a5553a0c4852e (patch)
tree79fad8747f4fea67182802e5e981f151d087adb4
parentc579312736163d8d038542408daaefad9659815d (diff)
downloadhostap-f0df5afa08fe511a008f6526cb9a5553a0c4852e.zip
hostap-f0df5afa08fe511a008f6526cb9a5553a0c4852e.tar.gz
hostap-f0df5afa08fe511a008f6526cb9a5553a0c4852e.tar.bz2
tests: PMKSA cache control interface events
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--tests/hwsim/test_pmksa_cache.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/hwsim/test_pmksa_cache.py b/tests/hwsim/test_pmksa_cache.py
index 8edf54e..c08fe19 100644
--- a/tests/hwsim/test_pmksa_cache.py
+++ b/tests/hwsim/test_pmksa_cache.py
@@ -888,3 +888,36 @@ def test_pmksa_cache_ctrl(dev, apdev):
raise Exception("PMKID mismatch in PMKSA cache entries after reconnect")
if pmksa_sta2['pmkid'] == pmksa_sta['pmkid']:
raise Exception("PMKID did not change after reconnect")
+
+def test_pmksa_cache_ctrl_events(dev, apdev):
+ """PMKSA cache control interface events"""
+ params = hostapd.wpa2_eap_params(ssid="test-pmksa-cache")
+ hapd = hostapd.add_ap(apdev[0], params)
+ bssid = apdev[0]['bssid']
+
+ id = dev[0].connect("test-pmksa-cache", proto="RSN", key_mgmt="WPA-EAP",
+ eap="GPSK", identity="gpsk user",
+ password="abcdefghijklmnop0123456789abcdef",
+ scan_freq="2412", wait_connect=False)
+
+ ev = dev[0].wait_event(["PMKSA-CACHE-ADDED"], timeout=15)
+ if ev is None:
+ raise Exception("No PMKSA-CACHE-ADDED event")
+ dev[0].wait_connected()
+ items = ev.split(' ')
+ if items[1] != bssid:
+ raise Exception("BSSID mismatch: " + ev)
+ if int(items[2]) != id:
+ raise Exception("network_id mismatch: " + ev)
+
+ dev[0].request("PMKSA_FLUSH")
+ ev = dev[0].wait_event(["PMKSA-CACHE-REMOVED"], timeout=15)
+ if ev is None:
+ raise Exception("No PMKSA-CACHE-REMOVED event")
+ dev[0].wait_disconnected()
+ dev[0].request("DISCONNECT")
+ items = ev.split(' ')
+ if items[1] != bssid:
+ raise Exception("BSSID mismatch: " + ev)
+ if int(items[2]) != id:
+ raise Exception("network_id mismatch: " + ev)