]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WPA2-PSK AP and GTK rekey by AP request
authorJouni Malinen <j@w1.fi>
Sun, 29 Oct 2017 15:00:50 +0000 (17:00 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Oct 2017 15:00:50 +0000 (17:00 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_psk.py

index 479006fa700a9d1fc5470c9d74350bef8fa7bace..f8da248c172b0cad3d8e3c40bc4214dcc2d56a8c 100644 (file)
@@ -325,6 +325,20 @@ def test_ap_wpa2_gtk_rekey(dev, apdev):
         raise Exception("GTK rekey timed out")
     hwsim_utils.test_connectivity(dev[0], hapd)
 
+def test_ap_wpa2_gtk_rekey_request(dev, apdev):
+    """WPA2-PSK AP and GTK rekey by AP request"""
+    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")
+    if "OK" not in hapd.request("REKEY_GTK"):
+        raise Exception("REKEY_GTK failed")
+    ev = dev[0].wait_event(["WPA: Group rekeying completed"], timeout=2)
+    if ev is None:
+        raise Exception("GTK rekey timed out")
+    hwsim_utils.test_connectivity(dev[0], hapd)
+
 @remote_compatible
 def test_ap_wpa_gtk_rekey(dev, apdev):
     """WPA-PSK/TKIP AP and GTK rekey enforced by AP"""