From: Jouni Malinen Date: Sun, 9 Mar 2014 22:18:49 +0000 (+0200) Subject: tests: Authenticator-initiated EAP reauthentication X-Git-Tag: hostap_2_2~624 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c50093f37b0e2baa6af748c0e63de35b46e67d5;p=thirdparty%2Fhostap.git tests: Authenticator-initiated EAP reauthentication Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 5a17077e5..e53dcfdb9 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -978,3 +978,25 @@ def test_ap_wpa2_eap_ttls_dh_params(dev, apdev): anonymous_identity="ttls", password="password", ca_cert="auth_serv/ca.der", phase2="auth=CHAP", dh_file="auth_serv/dh.conf") + +def test_ap_wpa2_eap_reauth(dev, apdev): + """WPA2-Enterprise and Authenticator forcing reauthentication""" + params = hostapd.wpa2_eap_params(ssid="test-wpa2-eap") + params['eap_reauth_period'] = '2' + hostapd.add_ap(apdev[0]['ifname'], params) + eap_connect(dev[0], apdev[0], "PAX", "pax.user@example.com", + password_hex="0123456789abcdef0123456789abcdef") + logger.info("Wait for reauthentication") + ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED"], timeout=10) + if ev is None: + raise Exception("Timeout on reauthentication") + ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=10) + if ev is None: + raise Exception("Timeout on reauthentication") + for i in range(0, 20): + state = dev[0].get_status_field("wpa_state") + if state == "COMPLETED": + break + time.sleep(0.1) + if state != "COMPLETED": + raise Exception("Reauthentication did not complete")