aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-10-27 18:19:45 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-27 18:19:45 (GMT)
commit1531402ee4888b28f85ce6333b0f6b7740675990 (patch)
tree3be7b6d8ac596ff4a726e4a5393df124e2c6e012 /tests
parent7465640066ce3215348ab94df8a6cfef8fff90b8 (diff)
downloadhostap-1531402ee4888b28f85ce6333b0f6b7740675990.zip
hostap-1531402ee4888b28f85ce6333b0f6b7740675990.tar.gz
hostap-1531402ee4888b28f85ce6333b0f6b7740675990.tar.bz2
tests: WPS with ap_scan=2
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_wps.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py
index 0dd2769..809ef69 100644
--- a/tests/hwsim/test_ap_wps.py
+++ b/tests/hwsim/test_ap_wps.py
@@ -19,6 +19,7 @@ import StringIO
import hwsim_utils
import hostapd
+from wpasupplicant import WpaSupplicant
def test_ap_wps_init(dev, apdev):
"""Initial AP configuration with first WPS Enrollee"""
@@ -2204,3 +2205,33 @@ def test_ap_wps_from_event(dev, apdev):
ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
if ev is None:
raise Exception("Association with the AP timed out")
+
+def test_ap_wps_ap_scan_2(dev, apdev):
+ """AP_SCAN 2 for WPS"""
+ ssid = "test-wps-conf"
+ hapd = 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.request("WPS_PBC")
+
+ wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+ wpas.interface_add("wlan5", drv_params="force_connect_cmd=1")
+
+ if "OK" not in wpas.request("AP_SCAN 2"):
+ raise Exception("Failed to set AP_SCAN 2")
+
+ wpas.request("WPS_PBC")
+ ev = wpas.wait_event(["WPS-SUCCESS"], timeout=15)
+ if ev is None:
+ raise Exception("WPS-SUCCESS event timed out")
+ ev = wpas.wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
+ if ev is None:
+ raise Exception("Association with the AP timed out")
+ wpas.request("DISCONNECT")
+ wpas.request("BSS_FLUSH 0")
+ wpas.dump_monitor()
+ wpas.request("REASSOCIATE")
+ ev = wpas.wait_event(["CTRL-EVENT-CONNECTED"], timeout=30)
+ if ev is None:
+ raise Exception("Association with the AP timed out")