From b49871ecc1df02fd235e9ba4fc95c33e25f8903b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 12 Dec 2016 00:58:00 +0200 Subject: [PATCH] tests: Fix wpas_ap_acs after 5 GHz use Work around the mac80211_hwsim limitation on channel survey by forcing the last connection to be on 2.4 GHz band. Without this, wpas_ap_acs would have failed to start the AP if the previous test case used the 5 GHz band. Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ap.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py index 5e0e816e6..8cd09f04c 100644 --- a/tests/hwsim/test_wpas_ap.py +++ b/tests/hwsim/test_wpas_ap.py @@ -387,6 +387,19 @@ def test_wpas_ap_acs(dev): if res is None or "ACS" not in res: raise HwsimSkip("ACS not supported") + # For now, make sure the last operating channel was on 2.4 GHz band to get + # sufficient survey data from mac80211_hwsim. + 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", "2412") + dev[0].set_network(id, "scan_freq", "2412") + dev[0].select_network(id) + wait_ap_ready(dev[0]) + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + id = dev[0].add_network() dev[0].set_network(id, "mode", "2") dev[0].set_network_quoted(id, "ssid", "wpas-ap-open")