tests: Do not drop HT capability on CS to avoid test failures

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>
This commit is contained in:
Jouni Malinen 2024-03-06 19:32:16 +02:00 committed by Jouni Malinen
parent 0a321d1733
commit 0eb67e43bb
2 changed files with 16 additions and 10 deletions

View 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)

View 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")