]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Do not drop HT capability on CS to avoid test failures
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 6 Mar 2024 17:32:16 +0000 (19:32 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 6 Mar 2024 17:32:16 +0000 (19:32 +0200)
Leave the HT capability of the AP as-is when running channel switch test
cases that started failing with a recent kernel change that disconnects
on such "unexpected" change in AP capabilities.

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

index 744d1e1f23ef55720e991ed472c8f7fe26fdf7d3..c9ac73291a2104f2be82734ef5d5077ce067b227 100644 (file)
@@ -21,8 +21,11 @@ def connect(dev, apdev, scan_freq="2412", **kwargs):
     dev.connect("ap-csa", key_mgmt="NONE", scan_freq=scan_freq)
     return ap
 
-def switch_channel(ap, count, freq):
-    ap.request("CHAN_SWITCH " + str(count) + " " + str(freq))
+def switch_channel(ap, count, freq, extra=None):
+    cmd = "CHAN_SWITCH " + str(count) + " " + str(freq)
+    if extra:
+        cmd += " " + extra
+    ap.request(cmd)
 
     ev = ap.wait_event(["CTRL-EVENT-STARTED-CHANNEL-SWITCH"], timeout=10)
     if ev is None:
@@ -54,6 +57,9 @@ def wait_channel_switch(dev, freq):
         raise Exception("Channel switch not reported")
     if "freq=%d" % freq not in ev:
         raise Exception("Unexpected frequency: " + ev)
+    ev = dev.wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=1)
+    if ev is not None:
+        raise Exception("Unexpected disconnection on channel switch")
 
 @remote_compatible
 def test_ap_csa_1_switch(dev, apdev):
@@ -68,7 +74,7 @@ def test_ap_csa_1_switch(dev, apdev):
         raise Exception("Unexpected driver freq=%d after association" % freq)
 
     hwsim_utils.test_connectivity(dev[0], ap)
-    switch_channel(ap, 10, 2462)
+    switch_channel(ap, 10, 2462, extra="ht")
     wait_channel_switch(dev[0], 2462)
     hwsim_utils.test_connectivity(dev[0], ap)
     freq = int(dev[0].get_driver_status_field("freq"))
@@ -87,10 +93,10 @@ def test_ap_csa_2_switches(dev, apdev):
     ap = connect(dev[0], apdev)
 
     hwsim_utils.test_connectivity(dev[0], ap)
-    switch_channel(ap, 10, 2462)
+    switch_channel(ap, 10, 2462, extra="ht")
     wait_channel_switch(dev[0], 2462)
     hwsim_utils.test_connectivity(dev[0], ap)
-    switch_channel(ap, 10, 2412)
+    switch_channel(ap, 10, 2412, extra="ht")
     wait_channel_switch(dev[0], 2412)
     hwsim_utils.test_connectivity(dev[0], ap)
 
@@ -151,7 +157,7 @@ def test_ap_csa_1_switch_count_2(dev, apdev):
     ap = connect(dev[0], apdev)
 
     hwsim_utils.test_connectivity(dev[0], ap)
-    switch_channel(ap, 2, 2462)
+    switch_channel(ap, 2, 2462, extra="ht")
     wait_channel_switch(dev[0], 2462)
     hwsim_utils.test_connectivity(dev[0], ap)
 
@@ -162,7 +168,7 @@ def test_ap_csa_ecsa_only(dev, apdev):
     ap = connect(dev[0], apdev, ecsa_ie_only="1")
 
     hwsim_utils.test_connectivity(dev[0], ap)
-    switch_channel(ap, 10, 2462)
+    switch_channel(ap, 10, 2462, extra="ht")
     wait_channel_switch(dev[0], 2462)
     hwsim_utils.test_connectivity(dev[0], ap)
 
index 194cb7e289176717a1af1d9211c78f81cb63a913..c9f09ee0e2804f4a273dc14acbdd0dab015d5014 100644 (file)
@@ -113,7 +113,7 @@ def test_ocv_sa_query_csa(dev, apdev):
                    key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2",
                    scan_freq="2412")
 
-    hapd.request("CHAN_SWITCH 5 2437")
+    hapd.request("CHAN_SWITCH 5 2437 ht")
     time.sleep(1)
     if wt.get_sta_counter("valid_saqueryreq_tx", apdev[0]['bssid'],
                           dev[0].own_addr()) < 1:
@@ -131,7 +131,7 @@ def test_ocv_sa_query_csa_no_resp(dev, apdev):
                    scan_freq="2412")
 
     hapd.set("ext_mgmt_frame_handling", "1")
-    hapd.request("CHAN_SWITCH 5 2437")
+    hapd.request("CHAN_SWITCH 5 2437 ht")
     ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=5)
     if ev is None:
         raise Exception("Disconnection after CSA not reported")
@@ -152,7 +152,7 @@ def test_ocv_sa_query_csa_missing(dev, apdev):
     if ev is None:
         raise Exception("Deauthentication frame RX not reported")
     hapd.set("ext_mgmt_frame_handling", "0")
-    hapd.request("CHAN_SWITCH 5 2437")
+    hapd.request("CHAN_SWITCH 5 2437 ht")
     ev = hapd.wait_event(["AP-STA-DISCONNECTED"], timeout=20)
     if ev is None:
         raise Exception("No disconnection event received from hostapd")