aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-01-08 15:36:57 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-08 15:36:57 (GMT)
commitcc5bf65f2964493465672bd8dd61ba2ddc400d80 (patch)
treeed20579cd65bee5ab3bfbc7577e25ac42419415b /tests
parent35320d7a44f7e6bff9bf676d9055d54dfcfc2005 (diff)
downloadhostap-cc5bf65f2964493465672bd8dd61ba2ddc400d80.zip
hostap-cc5bf65f2964493465672bd8dd61ba2ddc400d80.tar.gz
hostap-cc5bf65f2964493465672bd8dd61ba2ddc400d80.tar.bz2
tests: WPS_AP_PIN failure
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_wps.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py
index 79db6e6..0e96374 100644
--- a/tests/hwsim/test_ap_wps.py
+++ b/tests/hwsim/test_ap_wps.py
@@ -9904,3 +9904,25 @@ def test_ap_wps_pin_start_failure(dev, apdev):
with alloc_fail(dev[0], 1, "wpas_wps_start_dev_pw"):
if "FAIL" not in dev[0].request("WPS_PIN any"):
raise Exception("WPS_PIN not rejected during OOM")
+
+def test_ap_wps_ap_pin_failure(dev, apdev):
+ """WPS_AP_PIN failure"""
+ id = dev[0].add_network()
+ dev[0].set_network(id, "mode", "2")
+ dev[0].set_network_quoted(id, "ssid", "wpas-ap-wps")
+ dev[0].set_network_quoted(id, "psk", "1234567890")
+ dev[0].set_network(id, "frequency", "2412")
+ dev[0].set_network(id, "scan_freq", "2412")
+ dev[0].select_network(id)
+ dev[0].wait_connected()
+
+ with fail_test(dev[0], 1,
+ "os_get_random;wpa_supplicant_ctrl_iface_wps_ap_pin"):
+ if "FAIL" not in dev[0].request("WPS_AP_PIN random"):
+ raise Exception("WPS_AP_PIN random accepted")
+ with alloc_fail(dev[0], 1, "wpas_wps_ap_pin_set"):
+ if "FAIL" not in dev[0].request("WPS_AP_PIN set 12345670"):
+ raise Exception("WPS_AP_PIN set accepted")
+
+ dev[0].request("DISCONNECT")
+ dev[0].wait_disconnected()