]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P GO starting a persistent group with 80+80 MHz bandwidth
authorJouni Malinen <j@w1.fi>
Sat, 23 Dec 2023 10:19:07 +0000 (12:19 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 23 Dec 2023 10:20:24 +0000 (12:20 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_channel.py

index ed863198b741819d207cb363163c08daebbd4fbd..abae5572dcabf1109262f1565b976bbd086aca6f 100644 (file)
@@ -1243,11 +1243,33 @@ def test_p2p_channel_vht80p80(dev):
 
 def test_p2p_channel_vht80p80_autogo(dev):
     """P2P autonomous GO and VHT 80+80 MHz channel"""
+    run_p2p_channel_vht80p80_autogo(dev)
+
+def test_p2p_channel_vht80p80_autogo_persistent(dev):
+    """P2P autonomous GO and VHT 80+80 MHz channel (persistent group)"""
+    run_p2p_channel_vht80p80_autogo(dev, persistent=True)
+
+def run_p2p_channel_vht80p80_autogo(dev, persistent=False):
     addr0 = dev[0].p2p_dev_addr()
 
     try:
         set_country("US", dev[0])
-        if "OK" not in dev[0].global_request("P2P_GROUP_ADD vht freq=5180 freq2=5775"):
+
+        if persistent:
+            res = dev[0].p2p_start_go(persistent=True)
+            dev[0].remove_group()
+
+            networks = dev[0].list_networks(p2p=True)
+            if len(networks) != 1:
+                raise Exception("Unexpected number of networks")
+            if "[P2P-PERSISTENT]" not in networks[0]['flags']:
+                raise Exception("Not the persistent group data")
+            id = networks[0]['id']
+
+        cmd = "P2P_GROUP_ADD vht freq=5180 freq2=5775"
+        if persistent:
+            cmd += " persistent=" + id
+        if "OK" not in dev[0].global_request(cmd):
             raise Exception("Could not start GO")
         ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=5)
         if ev is None: