]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify WPS ER behavior on selecting a single Enrollee
authorJouni Malinen <j@w1.fi>
Sun, 2 Feb 2014 22:01:39 +0000 (00:01 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 4 Feb 2014 11:10:57 +0000 (13:10 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_ap_wps.py

index 6d67645de3bd195c968f353eaa164905c459ec3b..198390f1a895bd2ed06c7729edf65ea7be39a16e 100644 (file)
@@ -646,6 +646,25 @@ def test_ap_wps_er_add_enrollee(dev, apdev):
         raise Exception("WPS ER did not report success")
     hwsim_utils.test_connectivity_sta(dev[0], dev[1])
 
+    logger.info("Add a specific Enrollee using ER")
+    pin = dev[2].wps_read_pin()
+    addr2 = dev[2].p2p_interface_addr()
+    dev[0].dump_monitor()
+    dev[2].dump_monitor()
+    dev[2].request("WPS_PIN any " + pin)
+    ev = dev[0].wait_event(["WPS-ER-ENROLLEE-ADD"], timeout=10)
+    if ev is None:
+        raise Exception("Enrollee not seen")
+    if addr2 not in ev:
+        raise Exception("Unexpected Enrollee MAC address")
+    dev[0].request("WPS_ER_PIN " + addr2 + " " + pin + " " + addr2)
+    ev = dev[2].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
+    if ev is None:
+        raise Exception("Association with the AP timed out")
+    ev = dev[0].wait_event(["WPS-SUCCESS"], timeout=15)
+    if ev is None:
+        raise Exception("WPS ER did not report success")
+
     logger.info("Verify registrar selection behavior")
     dev[0].request("WPS_ER_PIN any " + pin + " " + dev[1].p2p_interface_addr())
     dev[1].request("DISCONNECT")