From e912986056aff7e1f9a39cfcdee9be3427ddd53f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 28 Dec 2013 19:46:02 +0200 Subject: [PATCH] tests: Verify concurrent WPS protocol run with assigned PIN Signed-hostap: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 8c3dac0ee..152d3fc21 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -183,6 +183,32 @@ def test_ap_wps_conf_pin(dev, apdev): if "WPS-M2D" not in ev: raise Exception("Unexpected WPS operation started") +def test_ap_wps_conf_pin_2sta(dev, apdev): + """Two stations trying to use WPS PIN at the same time""" + ssid = "test-wps-conf-pin2" + hostapd.add_ap(apdev[0]['ifname'], + { "ssid": ssid, "eap_server": "1", "wps_state": "2", + "wpa_passphrase": "12345678", "wpa": "2", + "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP"}) + hapd = hostapd.Hostapd(apdev[0]['ifname']) + logger.info("WPS provisioning step") + pin = "12345670" + pin2 = "55554444" + hapd.request("WPS_PIN " + dev[0].get_status_field("uuid") + " " + pin) + hapd.request("WPS_PIN " + dev[1].get_status_field("uuid") + " " + pin) + dev[0].request("SET ignore_old_scan_res 1") + dev[0].dump_monitor() + dev[1].request("SET ignore_old_scan_res 1") + dev[1].dump_monitor() + dev[0].request("WPS_PIN any " + pin) + dev[1].request("WPS_PIN any " + pin) + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30) + if ev is None: + raise Exception("Association with the AP timed out") + 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_reg_connect(dev, apdev): """WPS registrar using AP PIN to connect""" ssid = "test-wps-reg-ap-pin"