]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make PASN checks for PTKSA_CACHE_LIST a bit more robust
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 21 Feb 2023 17:46:17 +0000 (19:46 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 21 Feb 2023 17:46:17 +0000 (19:46 +0200)
It was apparently possible for the test script to fetch the
PTKSA_CACHE_LIST information from hostapd before the PASN message 3 had
been processed since only the event from wpa_supplicant related to
sending of that frame was explicitly waited for. Add a small wait to try
to avoid this race condition with UML time-travel.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_pasn.py

index 2a095faa460f54acfc69789256a97fae9e3dac23..bff09841c1f62d7e016d41d99b6f003bf71e79b7 100644 (file)
@@ -106,6 +106,11 @@ def check_pasn_akmp_cipher(dev, hapd, akmp="PASN", cipher="CCMP",
     if status:
         return
 
+    # There is a small window for a race condition here since the hostapd side
+    # might not yet have processed the PASN message 3 and added the PTKSA entry,
+    # so wait a bit before checking the results.
+    time.sleep(0.1)
+
     check_pasn_ptk(dev, hapd, cipher, fail_ptk)
 
 @remote_compatible