diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config index 718d47751..95095a2e2 100644 --- a/tests/hwsim/example-wpa_supplicant.config +++ b/tests/hwsim/example-wpa_supplicant.config @@ -84,6 +84,8 @@ CONFIG_MESH=y CONFIG_P2P=y CONFIG_WIFI_DISPLAY=y +CONFIG_ACS=y + CONFIG_BGSCAN_SIMPLE=y CONFIG_BGSCAN_LEARN=y diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py index 53de3992f..6d4a3c50e 100644 --- a/tests/hwsim/test_wpas_ap.py +++ b/tests/hwsim/test_wpas_ap.py @@ -334,3 +334,26 @@ def test_wpas_ap_disable(dev): if ev is None: raise Exception("AP-DISABLED event not seen") dev[0].wait_disconnected() + +def test_wpas_ap_acs(dev): + """wpa_supplicant AP mode - ACS""" + res = dev[0].get_capability("acs") + if res is None or "ACS" not in res: + raise HwsimSkip("ACS not supported") + + id = dev[0].add_network() + dev[0].set_network(id, "mode", "2") + dev[0].set_network_quoted(id, "ssid", "wpas-ap-open") + dev[0].set_network(id, "key_mgmt", "NONE") + dev[0].set_network(id, "frequency", "2417") + dev[0].set_network(id, "scan_freq", "2417") + dev[0].set_network(id, "acs", "1") + dev[0].select_network(id) + wait_ap_ready(dev[0]) + + # ACS prefers channels 1, 6, 11 + freq = dev[0].get_status_field('freq') + if freq == "2417": + raise Exception("Unexpected operating channel selected") + + dev[1].connect("wpas-ap-open", key_mgmt="NONE", scan_freq=freq)