From 6e12eaa449faa60a260c6387f999167d533b15eb Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 11 Apr 2014 23:04:18 +0300 Subject: [PATCH] tests: Additional WPS ctrl_iface coverage Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 7 ++++++- tests/hwsim/test_wpas_ap.py | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index ca293d430..f8e6c63cc 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -349,12 +349,16 @@ def test_ap_wps_conf_pin(dev, apdev): if "[WPS-AUTH]" in bss['flags']: raise Exception("WPS-AUTH flag not cleared") logger.info("Try to connect from another station using the same PIN") - dev[1].request("WPS_PIN any " + pin) + pin = dev[1].request("WPS_PIN any") ev = dev[1].wait_event(["WPS-M2D","CTRL-EVENT-CONNECTED"], timeout=30) if ev is None: raise Exception("Operation timed out") if "WPS-M2D" not in ev: raise Exception("Unexpected WPS operation started") + hapd.request("WPS_PIN any " + pin) + 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_conf_pin_2sta(dev, apdev): """Two stations trying to use WPS PIN at the same time""" @@ -1139,6 +1143,7 @@ def test_ap_wps_check_pin(dev, apdev): for t in [ ("12345670", "12345670"), ("12345678", "FAIL-CHECKSUM"), ("12345", "FAIL"), + ("123456789", "FAIL"), ("1234-5670", "12345670"), ("1234 5670", "12345670"), ("1-2.3:4 5670", "12345670") ]: diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py index a1bd99737..5cce14feb 100644 --- a/tests/hwsim/test_wpas_ap.py +++ b/tests/hwsim/test_wpas_ap.py @@ -188,6 +188,14 @@ def test_wpas_ap_wps(dev): dev[1].request("REMOVE_NETWORK all") dev[1].dump_monitor() + dev[0].request("WPS_PIN any " + pin + " 100") + dev[1].request("WPS_PIN any " + pin) + ev = dev[1].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30) + if ev is None: + raise Exception("Association with the AP timed out") + dev[1].request("REMOVE_NETWORK all") + dev[1].dump_monitor() + dev[0].request("WPS_AP_PIN set 12345670") dev[0].dump_monitor()