tests: Make FT PMKSA caching test cases more robust

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>
This commit is contained in:
Jouni Malinen 2019-12-24 19:04:36 +02:00
parent c0f3ee475b
commit 9f47fdb6c3

View file

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