]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPA2-PSK AP and GTK rekey request from multiple stations
authorJouni Malinen <jouni@codeaurora.org>
Mon, 10 May 2021 22:05:22 +0000 (01:05 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 10 May 2021 22:05:22 +0000 (01:05 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_psk.py

index b6048be138440c027201aa8e60e1395c788b63df..2271fc3539ddd97e61ecacd0c5cefeba9fb846ff 100644 (file)
@@ -516,6 +516,26 @@ def test_ap_wpa2_gtk_rekey_failure(dev, apdev):
         raise Exception("GTK rekey timed out")
     dev[0].wait_disconnected()
 
+def test_ap_wpa2_gtk_rekey_request(dev, apdev):
+    """WPA2-PSK AP and GTK rekey request from multiple stations"""
+    ssid = "test-wpa2-psk"
+    passphrase = 'qwertyuiop'
+    params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
+    hapd = hostapd.add_ap(apdev[0], params)
+    for i in range(3):
+        dev[i].connect(ssid, psk=passphrase, scan_freq="2412")
+        hapd.wait_sta()
+    for i in range(3):
+        if "OK" not in dev[i].request("KEY_REQUEST 0 0"):
+            raise Exception("KEY_REQUEST failed")
+    for i in range(3):
+        ev = dev[i].wait_event(["WPA: Group rekeying completed"], timeout=2)
+        if ev is None:
+            raise Exception("GTK rekey timed out")
+    time.sleep(1)
+    for i in range(3):
+        hwsim_utils.test_connectivity(dev[i], hapd)
+
 @remote_compatible
 def test_ap_wpa_gtk_rekey(dev, apdev):
     """WPA-PSK/TKIP AP and GTK rekey enforced by AP"""