]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Automatic channel selection with fallback to 20 MHz
authorJouni Malinen <jouni@codeaurora.org>
Fri, 6 Mar 2020 18:50:21 +0000 (20:50 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 6 Mar 2020 19:44:31 +0000 (21:44 +0200)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_acs.py

index 866fd725c28f8472cbbb3ae741a39c3c224448e1..ed05c903ae446cdb3392f3b78456f3eea1d33d73 100644 (file)
@@ -551,3 +551,26 @@ def test_ap_acs_hw_mode_any_5ghz(dev, apdev):
         dev[0].wait_regdom(country_ie=True)
     finally:
         clear_regdom(hapd, dev)
+
+def test_ap_acs_with_fallback_to_20(dev, apdev):
+    """Automatic channel selection with fallback to 20 MHz"""
+    force_prev_ap_on_24g(apdev[0])
+    params = {"ssid": "legacy-20",
+              "channel": "7", "ieee80211n": "0"}
+    hostapd.add_ap(apdev[1], params)
+    params = hostapd.wpa2_params(ssid="test-acs", passphrase="12345678")
+    params['channel'] = '0'
+    params['acs_chan_bias'] = '6:0.1'
+    params['ht_capab'] = '[HT40+]'
+    hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
+    wait_acs(hapd)
+
+    freq = hapd.get_status_field("freq")
+    if int(freq) < 2400:
+        raise Exception("Unexpected frequency")
+
+    dev[0].connect("test-acs", psk="12345678", scan_freq=freq)
+    sig = dev[0].request("SIGNAL_POLL").splitlines()
+    logger.info("SIGNAL_POLL: " + str(sig))
+    if "WIDTH=20 MHz" not in sig:
+        raise Exception("Station did not report 20 MHz bandwidth")