]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPA2-PSK AP and GTK rekey failure
authorJouni Malinen <j@w1.fi>
Wed, 24 Mar 2021 22:49:02 +0000 (00:49 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 25 Mar 2021 22:21:18 +0000 (00:21 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_psk.py

index be6a88b2a1645e4dcf626e3e55047e325d14e8c4..b6048be138440c027201aa8e60e1395c788b63df 100644 (file)
@@ -500,6 +500,22 @@ def test_ap_wpa2_gtk_rekey_request(dev, apdev):
         raise Exception("GTK rekey timed out")
     hwsim_utils.test_connectivity(dev[0], hapd)
 
+def test_ap_wpa2_gtk_rekey_failure(dev, apdev):
+    """WPA2-PSK AP and GTK rekey failure"""
+    ssid = "test-wpa2-psk"
+    passphrase = 'qwertyuiop'
+    params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
+    hapd = hostapd.add_ap(apdev[0], params)
+    dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
+    with fail_test(hapd, 1, "wpa_group_config_group_keys"):
+        if "OK" not in hapd.request("REKEY_GTK"):
+            raise Exception("REKEY_GTK failed")
+        wait_fail_trigger(hapd, "GET_FAIL")
+    ev = dev[0].wait_event(["WPA: Group rekeying completed"], timeout=2)
+    if ev is None:
+        raise Exception("GTK rekey timed out")
+    dev[0].wait_disconnected()
+
 @remote_compatible
 def test_ap_wpa_gtk_rekey(dev, apdev):
     """WPA-PSK/TKIP AP and GTK rekey enforced by AP"""