]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make sae_proto_hostapd_status_* more robust
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 22 Aug 2023 16:46:44 +0000 (19:46 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 22 Aug 2023 16:46:44 +0000 (19:46 +0300)
The first MGMT-TX-STATUS event might be for the initial broadcast
Deauthentication frame instead of the SAE Authentication frame. Skip the
first event and try to process TX status for the first Authentication
frame instead.

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

index ff58598b009e95d2a8150328da932ebf24242813..97361d80631f2cdc0ebad02540c280c66a032c2e 100644 (file)
@@ -1226,8 +1226,13 @@ def check_commit_status(hapd, use_status, expect_status):
     element_x = "559cb8928db4ce4e3cbd6555e837591995e5ebe503ef36b503d9ca519d63728d"
     element_y = "d3c7c676b8e8081831b6bc3a64bdf136061a7de175e17d1965bfa41983ed02f8"
     status = binascii.hexlify(struct.pack('<H', use_status)).decode()
+    hapd.dump_monitor()
     hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + "03000100" + status + group + scalar + element_x + element_y)
     ev = hapd.wait_event(["MGMT-TX-STATUS"], timeout=5)
+    if ev:
+        msg = ev.split(' ')[3].split('=')[1]
+        if not msg.startswith("b0"):
+            ev = hapd.wait_event(["MGMT-TX-STATUS"], timeout=5)
     if ev is None:
         raise Exception("MGMT-TX-STATUS not seen")
     msg = ev.split(' ')[3].split('=')[1]