]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix autogo_chan_switch to not drop HT capability
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 22 Apr 2024 13:17:39 +0000 (16:17 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 22 Apr 2024 13:17:39 +0000 (16:17 +0300)
This test case ended up dropping HT capability on channel switch which
is now resulting in mac80211 disconnecting. Avoid this by leaving HT
enabled. In addition, check the P2P Client events explicitly.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
tests/hwsim/test_p2p_autogo.py

index d020336f602fbed097829a0e4af41c106ca65207..06be70f1629d3530b6f4ae0cc101806d82c0330f 100644 (file)
@@ -359,7 +359,7 @@ def test_autogo_chan_switch(dev):
 def run_autogo_chan_switch(dev):
     autogo(dev[0], freq=2417)
     connect_cli(dev[0], dev[1], freq=2417)
-    res = dev[0].group_request("CHAN_SWITCH 5 2422")
+    res = dev[0].group_request("CHAN_SWITCH 5 2422 ht")
     if "FAIL" in res:
         # for now, skip test since mac80211_hwsim support is not yet widely
         # deployed
@@ -368,7 +368,16 @@ def run_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-STARTED-CHANNEL-SWITCH"], timeout=10)
+    if ev is None or "freq=2422" not in ev:
+        raise Exception("Channel switch started event not received on client")
+    ev = dev[1].wait_event(["CTRL-EVENT-CHANNEL-SWITCH"], timeout=10)
+    if ev is None or "freq=2422" not in ev:
+        raise Exception("Channel switch event not received on client")
+    ev = dev[1].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=0.1)
+    if ev is not None:
+        raise Exception("Unexpected disconnection after channel switch")
     dev[0].dump_monitor()
     dev[1].dump_monitor()
     time.sleep(0.1)