]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Additional WPS ctrl_iface coverage
authorJouni Malinen <j@w1.fi>
Fri, 11 Apr 2014 20:04:18 +0000 (23:04 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 07:26:51 +0000 (10:26 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_wps.py
tests/hwsim/test_wpas_ap.py

index ca293d430317690a0e8582b32acc8e3bb3f518f4..f8e6c63cc82ea7c703d77de06f12266f265d34c1 100644 (file)
@@ -349,12 +349,16 @@ def test_ap_wps_conf_pin(dev, apdev):
     if "[WPS-AUTH]" in bss['flags']:
         raise Exception("WPS-AUTH flag not cleared")
     logger.info("Try to connect from another station using the same PIN")
-    dev[1].request("WPS_PIN any " + pin)
+    pin = dev[1].request("WPS_PIN any")
     ev = dev[1].wait_event(["WPS-M2D","CTRL-EVENT-CONNECTED"], timeout=30)
     if ev is None:
         raise Exception("Operation timed out")
     if "WPS-M2D" not in ev:
         raise Exception("Unexpected WPS operation started")
+    hapd.request("WPS_PIN any " + pin)
+    ev = dev[1].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
+    if ev is None:
+        raise Exception("Association with the AP timed out")
 
 def test_ap_wps_conf_pin_2sta(dev, apdev):
     """Two stations trying to use WPS PIN at the same time"""
@@ -1139,6 +1143,7 @@ def test_ap_wps_check_pin(dev, apdev):
     for t in [ ("12345670", "12345670"),
                ("12345678", "FAIL-CHECKSUM"),
                ("12345", "FAIL"),
+               ("123456789", "FAIL"),
                ("1234-5670", "12345670"),
                ("1234 5670", "12345670"),
                ("1-2.3:4 5670", "12345670") ]:
index a1bd9973782bacbee2d17cf7c03d5aca207a667e..5cce14feb8c6d3cc466432dc54a5bf9b26f04c91 100644 (file)
@@ -188,6 +188,14 @@ def test_wpas_ap_wps(dev):
     dev[1].request("REMOVE_NETWORK all")
     dev[1].dump_monitor()
 
+    dev[0].request("WPS_PIN any " + pin + " 100")
+    dev[1].request("WPS_PIN any " + pin)
+    ev = dev[1].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
+    if ev is None:
+        raise Exception("Association with the AP timed out")
+    dev[1].request("REMOVE_NETWORK all")
+    dev[1].dump_monitor()
+
     dev[0].request("WPS_AP_PIN set 12345670")
     dev[0].dump_monitor()