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")