From: Jouni Malinen Date: Sun, 5 Jan 2014 12:20:36 +0000 (+0200) Subject: tests: Validate EAP-GPSK cipher suite negotiation X-Git-Tag: hostap_2_1~186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=369f9c20eeb961510a87f96ace250751354620b3;p=thirdparty%2Fhostap.git tests: Validate EAP-GPSK cipher suite negotiation This covers all currently supported algorithms and the case of no match. Signed-hostap: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index f7e4a117d..7a7f1edf2 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -334,10 +334,26 @@ def test_ap_wpa2_eap_gpsk(dev, apdev): """WPA2-Enterprise connection using EAP-GPSK""" params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") hostapd.add_ap(apdev[0]['ifname'], params) - eap_connect(dev[0], "GPSK", "gpsk user", - password="abcdefghijklmnop0123456789abcdef") + id = eap_connect(dev[0], "GPSK", "gpsk user", + password="abcdefghijklmnop0123456789abcdef") eap_reauth(dev[0], "GPSK") + logger.info("Test forced algorithm selection") + for phase1 in [ "cipher=1", "cipher=2" ]: + dev[0].set_network_quoted(id, "phase1", phase1) + ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=10) + if ev is None: + raise Exception("EAP success timed out") + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=10) + if ev is None: + raise Exception("Association with the AP timed out") + + logger.info("Test failed algorithm negotiation") + dev[0].set_network_quoted(id, "phase1", "cipher=9") + ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"], timeout=10) + if ev is None: + raise Exception("EAP failure timed out") + def test_ap_wpa2_eap_sake(dev, apdev): """WPA2-Enterprise connection using EAP-SAKE""" params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap")