Browse Source

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 <j@w1.fi>
Jouni Malinen 8 years ago
parent
commit
b49871ecc1
1 changed files with 13 additions and 0 deletions
  1. 13 0
      tests/hwsim/test_wpas_ap.py

+ 13 - 0
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:
     if res is None or "ACS" not in res:
         raise HwsimSkip("ACS not supported")
         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()
     id = dev[0].add_network()
     dev[0].set_network(id, "mode", "2")
     dev[0].set_network(id, "mode", "2")
     dev[0].set_network_quoted(id, "ssid", "wpas-ap-open")
     dev[0].set_network_quoted(id, "ssid", "wpas-ap-open")