]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Automatic channel selection with hw_mode=any
authorJouni Malinen <j@w1.fi>
Fri, 28 Feb 2020 14:15:24 +0000 (16:15 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 29 Feb 2020 09:23:03 +0000 (11:23 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_acs.py

index fe88d017183599e5cd031deb4740d5f7ff782ea3..866fd725c28f8472cbbb3ae741a39c3c224448e1 100644 (file)
@@ -515,3 +515,39 @@ def test_ap_acs_vht160_dfs(dev, apdev, params):
         hostapd.cmd_execute(apdev[0], ['iw', 'reg', 'set', '00'])
         dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5)
         dev[0].flush_scan_cache()
+
+def test_ap_acs_hw_mode_any(dev, apdev):
+    """Automatic channel selection with hw_mode=any"""
+    force_prev_ap_on_24g(apdev[0])
+    params = hostapd.wpa2_params(ssid="test-acs", passphrase="12345678")
+    params['channel'] = '0'
+    params['hw_mode'] = 'any'
+    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)
+
+def test_ap_acs_hw_mode_any_5ghz(dev, apdev):
+    """Automatic channel selection with hw_mode=any and 5 GHz"""
+    try:
+        hapd = None
+        force_prev_ap_on_5g(apdev[0])
+        params = hostapd.wpa2_params(ssid="test-acs", passphrase="12345678")
+        params['hw_mode'] = 'any'
+        params['channel'] = '0'
+        params['country_code'] = 'US'
+        params['acs_chan_bias'] = '36:0.7 40:0.7 44:0.7 48:0.7'
+        hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False)
+        wait_acs(hapd)
+        freq = hapd.get_status_field("freq")
+        if int(freq) < 5000:
+            raise Exception("Unexpected frequency")
+
+        dev[0].connect("test-acs", psk="12345678", scan_freq=freq)
+        dev[0].wait_regdom(country_ie=True)
+    finally:
+        clear_regdom(hapd, dev)