]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: DPP push button and unsupported AP configuration
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 26 Aug 2022 21:51:25 +0000 (00:51 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 26 Aug 2022 21:51:25 +0000 (00:51 +0300)
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_dpp3.py

index 0ee71b12c208da50143422026989fd1861e89338..b4d7116bcfba54bebffdab90aec1b2866e93ce86 100644 (file)
@@ -313,6 +313,29 @@ def test_dpp_push_button(dev, apdev):
     finally:
         dev[0].set("dpp_config_processing", "0", allow_fail=True)
 
+def test_dpp_push_button_unsupported_ap_conf(dev, apdev):
+    """DPP push button and unsupported AP configuration"""
+    check_dpp_capab(dev[0], min_ver=3)
+
+    params = {"ssid": "open",
+              "dpp_configurator_connectivity": "1"}
+    hapd = hostapd.add_ap(apdev[0], params)
+    if "OK" not in hapd.request("DPP_PUSH_BUTTON"):
+        raise Exception("Failed to press push button on the AP")
+    if "OK" not in dev[0].request("DPP_PUSH_BUTTON"):
+        raise Exception("Failed to press push button on the station")
+    ev = hapd.wait_event(["DPP-PB-RESULT"], timeout=30)
+    if ev is None or "failed" not in ev:
+        raise Exception("Push button bootstrapping did not fail on AP")
+    while True:
+        ev = dev[0].wait_event(["DPP-PB-RESULT", "DPP-RX"], timeout=100)
+        if ev is None:
+            raise Exception("Push button result not reported on station")
+        if "DPP-PB-RESULT failed" in ev:
+            break
+        if "type=18" in ev:
+            raise Exception("Unexpected PKEX initiation seen")
+
 def test_dpp_push_button_session_overlap_sta(dev, apdev):
     """DPP push button and session overlap detected by STA"""
     check_dpp_capab(dev[0], min_ver=3)