]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make DPP text cases more robust for DPP-TX event processing
authorJouni Malinen <j@w1.fi>
Sun, 22 Dec 2019 21:33:21 +0000 (23:33 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 22 Dec 2019 21:33:21 +0000 (23:33 +0200)
The previous waits were matching both DPP-TX and DPP-TX-STATUS and if
the latter event was received, the test cases would either report
failure or would not really test what was supposed to be verified. Fix
this by waiting explicitly for "DPP-TX " to avoid matching
"DPP-TX-STATUS" prefix.

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

index c0e9928f0ac53d2748a576c326c26a54d2c83059..95bf934f97af49f0560751b833ac3db80ff317ba 100644 (file)
@@ -439,7 +439,7 @@ def test_dpp_auth_resp_retries(dev, apdev):
     logger.info("dev0 scans QR Code")
     id0b = dev[0].dpp_qr_code(uri1b)
 
-    ev = dev[0].wait_event(["DPP-TX"], timeout=5)
+    ev = dev[0].wait_event(["DPP-TX "], timeout=5)
     if ev is None or "type=1" not in ev:
         raise Exception("DPP Authentication Response not sent")
     ev = dev[0].wait_event(["DPP-TX-STATUS"], timeout=5)
@@ -448,7 +448,7 @@ def test_dpp_auth_resp_retries(dev, apdev):
     if "result=no-ACK" not in ev:
         raise Exception("Unexpected TX status for Authentication Response: " + ev)
 
-    ev = dev[0].wait_event(["DPP-TX"], timeout=15)
+    ev = dev[0].wait_event(["DPP-TX "], timeout=15)
     if ev is None or "type=1" not in ev:
         raise Exception("DPP Authentication Response retransmission not sent")
 
@@ -655,7 +655,7 @@ def test_dpp_qr_code_auth_neg_chan(dev, apdev):
     dev[1].dpp_auth_init(uri=uri0, conf="sta-dpp", neg_freq=2462,
                          configurator=conf_id)
 
-    ev = dev[1].wait_event(["DPP-TX"], timeout=5)
+    ev = dev[1].wait_event(["DPP-TX "], timeout=5)
     if ev is None:
         raise Exception("DPP Authentication Request not sent")
     if "freq=2412 type=0" not in ev:
@@ -673,7 +673,7 @@ def test_dpp_qr_code_auth_neg_chan(dev, apdev):
     if "freq=2412 result=SUCCESS" not in ev:
         raise Exception("Unexpected TX status for Authentication Request: " + ev)
 
-    ev = dev[0].wait_event(["DPP-TX"], timeout=5)
+    ev = dev[0].wait_event(["DPP-TX "], timeout=5)
     if ev is None:
         raise Exception("DPP Authentication Response not sent")
     if "freq=2462 type=1" not in ev:
@@ -691,7 +691,7 @@ def test_dpp_qr_code_auth_neg_chan(dev, apdev):
     if "freq=2462 result=SUCCESS" not in ev:
         raise Exception("Unexpected TX status for Authentication Response: " + ev)
 
-    ev = dev[1].wait_event(["DPP-TX"], timeout=5)
+    ev = dev[1].wait_event(["DPP-TX "], timeout=5)
     if ev is None:
         raise Exception("DPP Authentication Confirm not sent")
     if "freq=2462 type=2" not in ev:
@@ -3323,7 +3323,7 @@ def test_dpp_proto_network_introduction(dev, apdev):
                        dpp_netaccesskey=params1_sta_netaccesskey,
                        wait_connect=False)
 
-        ev = dev[0].wait_event(["DPP-TX"], timeout=10)
+        ev = dev[0].wait_event(["DPP-TX "], timeout=10)
         if ev is None or "type=5" not in ev:
             raise Exception("Peer Discovery Request TX not reported")
         ev = dev[0].wait_event(["DPP-TX-STATUS"], timeout=2)