]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix wpas_ap_acs after 5 GHz use
authorJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 22:58:00 +0000 (00:58 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Dec 2016 22:58:00 +0000 (00:58 +0200)
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 <j@w1.fi>
tests/hwsim/test_wpas_ap.py

index 5e0e816e6c85465602d2e7accd282d0b58760f9b..8cd09f04cd8b64699601ba62b6432d3d28405873 100644 (file)
@@ -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")