]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Authenticator-initiated EAP reauthentication
authorJouni Malinen <j@w1.fi>
Sun, 9 Mar 2014 22:18:49 +0000 (00:18 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 9 Mar 2014 22:18:49 +0000 (00:18 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_eap.py

index 5a17077e54e21bf56276cf6b96bb9e1aad9f8328..e53dcfdb965226bd81e1f7dc712f76cf58aa1786 100644 (file)
@@ -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")