From: Jouni Malinen Date: Sun, 7 Dec 2014 15:47:02 +0000 (+0200) Subject: tests: wpa_supplicant WPS_AP_PIN random PIN timeout and error caes X-Git-Tag: hostap_2_4~896 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e33f9c67f25a9a0f56112d4ce4f5da74c2c5845;p=thirdparty%2Fhostap.git tests: wpa_supplicant WPS_AP_PIN random PIN timeout and error caes Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py index 15f38c707..deca65fa7 100644 --- a/tests/hwsim/test_wpas_ap.py +++ b/tests/hwsim/test_wpas_ap.py @@ -217,3 +217,24 @@ def test_wpas_ap_wps(dev): ev = dev[0].wait_event(["WPS-AP-SETUP-LOCKED"]) if ev is None: raise Exception("WPS AP PIN not locked") + + dev[0].dump_monitor() + logger.info("Test random AP PIN timeout") + pin = dev[0].request("WPS_AP_PIN random 1") + if "FAIL" in pin: + raise Exception("Could not generate random AP PIN") + res = dev[0].request("WPS_AP_PIN get") + if pin not in res: + raise Exception("Could not fetch current AP PIN") + for i in range(10): + time.sleep(0.2) + res = dev[0].request("WPS_AP_PIN get") + if "FAIL" in res: + break + if "FAIL" not in res: + raise Exception("WPS_AP_PIN random timeout did not work") + + if "FAIL" not in dev[0].request("WPS_AP_PIN foo"): + raise Exception("Invalid WPS_AP_PIN command not rejected") + if "FAIL" not in dev[0].request("WPS_AP_PIN set"): + raise Exception("Invalid WPS_AP_PIN command not rejected")