]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make FT PMKSA caching test cases more robust
authorJouni Malinen <j@w1.fi>
Tue, 24 Dec 2019 17:04:36 +0000 (19:04 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 24 Dec 2019 19:16:23 +0000 (21:16 +0200)
The RECONNECT command on the station was issued immediately after
wpa_supplicant had processed EAPOL-Key msg 3/4. This could happen before
hostapd has processed EAPOL-Key msg 4/4 and especially with UML
time-travel, this could result in the following FT protocol exchange
going through in a manner that makes the hostapd process EAPOL-Key msg
4/4 from the first association as a postponed EAPOL RX at the beginning
of the second association. Avoid this by waiting hostapd to report
completion of the connection before issuing RECONNECT.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_ft.py

index 5404e1f5301ce9245df7082a1d6c90939c9ed1d8..51a070e8eb9651807f938921230851fc02a6dc07 100644 (file)
@@ -175,6 +175,10 @@ def run_roams(dev, apdev, hapd0, hapd1, ssid, passphrase, over_ds=False,
         copts["bssid"] = apdev[0]['bssid']
     netw = dev.connect(ssid, **copts)
     if pmksa_caching:
+        if dev.get_status_field('bssid') == apdev[0]['bssid']:
+            hapd0.wait_sta()
+        else:
+            hapd1.wait_sta()
         dev.request("DISCONNECT")
         dev.wait_disconnected()
         dev.request("RECONNECT")