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:
parent
0a321d1733
commit
0eb67e43bb
2 changed files with 16 additions and 10 deletions
|
@ -21,8 +21,11 @@ def connect(dev, apdev, scan_freq="2412", **kwargs):
|
||||||
dev.connect("ap-csa", key_mgmt="NONE", scan_freq=scan_freq)
|
dev.connect("ap-csa", key_mgmt="NONE", scan_freq=scan_freq)
|
||||||
return ap
|
return ap
|
||||||
|
|
||||||
def switch_channel(ap, count, freq):
|
def switch_channel(ap, count, freq, extra=None):
|
||||||
ap.request("CHAN_SWITCH " + str(count) + " " + str(freq))
|
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)
|
ev = ap.wait_event(["CTRL-EVENT-STARTED-CHANNEL-SWITCH"], timeout=10)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
|
@ -54,6 +57,9 @@ def wait_channel_switch(dev, freq):
|
||||||
raise Exception("Channel switch not reported")
|
raise Exception("Channel switch not reported")
|
||||||
if "freq=%d" % freq not in ev:
|
if "freq=%d" % freq not in ev:
|
||||||
raise Exception("Unexpected frequency: " + 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
|
@remote_compatible
|
||||||
def test_ap_csa_1_switch(dev, apdev):
|
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)
|
raise Exception("Unexpected driver freq=%d after association" % freq)
|
||||||
|
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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)
|
wait_channel_switch(dev[0], 2462)
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
hwsim_utils.test_connectivity(dev[0], ap)
|
||||||
freq = int(dev[0].get_driver_status_field("freq"))
|
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)
|
ap = connect(dev[0], apdev)
|
||||||
|
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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)
|
wait_channel_switch(dev[0], 2462)
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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)
|
wait_channel_switch(dev[0], 2412)
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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)
|
ap = connect(dev[0], apdev)
|
||||||
|
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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)
|
wait_channel_switch(dev[0], 2462)
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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")
|
ap = connect(dev[0], apdev, ecsa_ie_only="1")
|
||||||
|
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
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)
|
wait_channel_switch(dev[0], 2462)
|
||||||
hwsim_utils.test_connectivity(dev[0], ap)
|
hwsim_utils.test_connectivity(dev[0], ap)
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ def test_ocv_sa_query_csa(dev, apdev):
|
||||||
key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2",
|
key_mgmt="WPA-PSK WPA-PSK-SHA256", proto="WPA2",
|
||||||
scan_freq="2412")
|
scan_freq="2412")
|
||||||
|
|
||||||
hapd.request("CHAN_SWITCH 5 2437")
|
hapd.request("CHAN_SWITCH 5 2437 ht")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if wt.get_sta_counter("valid_saqueryreq_tx", apdev[0]['bssid'],
|
if wt.get_sta_counter("valid_saqueryreq_tx", apdev[0]['bssid'],
|
||||||
dev[0].own_addr()) < 1:
|
dev[0].own_addr()) < 1:
|
||||||
|
@ -131,7 +131,7 @@ def test_ocv_sa_query_csa_no_resp(dev, apdev):
|
||||||
scan_freq="2412")
|
scan_freq="2412")
|
||||||
|
|
||||||
hapd.set("ext_mgmt_frame_handling", "1")
|
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)
|
ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=5)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Disconnection after CSA not reported")
|
raise Exception("Disconnection after CSA not reported")
|
||||||
|
@ -152,7 +152,7 @@ def test_ocv_sa_query_csa_missing(dev, apdev):
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("Deauthentication frame RX not reported")
|
raise Exception("Deauthentication frame RX not reported")
|
||||||
hapd.set("ext_mgmt_frame_handling", "0")
|
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)
|
ev = hapd.wait_event(["AP-STA-DISCONNECTED"], timeout=20)
|
||||||
if ev is None:
|
if ev is None:
|
||||||
raise Exception("No disconnection event received from hostapd")
|
raise Exception("No disconnection event received from hostapd")
|
||||||
|
|
Loading…
Reference in a new issue