]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use CS more carefully in p2p_device_autogo_chan_switch
authorJouni Malinen <j@w1.fi>
Sat, 9 Mar 2024 16:08:52 +0000 (18:08 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 9 Mar 2024 16:08:52 +0000 (18:08 +0200)
Do not disable HT support on the GO and wait for the channel switch
event on the P2P Client before proceeding with connectivity test.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_device.py

index aeece31b680b2885325dfb95da5cce6b0fe18fbf..47ca25bdd0f0cb1ca82d62d928d1765c942df228 100644 (file)
@@ -545,7 +545,7 @@ def test_p2p_device_autogo_chan_switch(dev):
         wpas.global_request("SET p2p_no_group_iface 1")
         autogo(wpas, freq=2417)
         connect_cli(wpas, dev[1])
-        res = wpas.group_request("CHAN_SWITCH 5 2422")
+        res = wpas.group_request("CHAN_SWITCH 5 2422 ht")
         if "FAIL" in res:
             # for now, skip test since mac80211_hwsim support is not yet widely
             # deployed
@@ -554,7 +554,12 @@ def test_p2p_device_autogo_chan_switch(dev):
         if ev is None:
             raise Exception("CSA finished event timed out")
         if "freq=2422" not in ev:
-            raise Exception("Unexpected cahnnel in CSA finished event")
+            raise Exception("Unexpected channel in CSA finished event")
+        ev = dev[1].wait_event(["CTRL-EVENT-CHANNEL-SWITCH"], timeout=2)
+        if ev is None:
+            raise Exception("Channel switch not reported on P2P Client")
+        if "freq=2422" not in ev:
+            raise Exception("Unexpected channel in CS event")
         wpas.dump_monitor()
         dev[1].dump_monitor()
         time.sleep(0.1)