From fd78ab827085574fb75955907fdada9848cde5b9 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 15 Feb 2021 18:14:25 +0200 Subject: [PATCH] tests: ACS for HE 40 MHz channel in 2.4 GHz Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_acs.py | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index eb245e7c3..08eaee5fd 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -622,3 +622,43 @@ def test_ap_acs_rx_during(dev, apdev): finally: for i in range(3): dev[i].request("SCAN_INTERVAL 5") + +def test_ap_acs_he_24g(dev, apdev): + """Automatic channel selection on 2.4 GHz with HE""" + clear_scan_cache(apdev[0]) + force_prev_ap_on_24g(apdev[0]) + + params = hostapd.wpa2_params(ssid="test-acs", passphrase="12345678") + params['channel'] = '0' + params['ieee80211ax'] = '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) + +def test_ap_acs_he_24g_overlap(dev, apdev): + """Automatic channel selection on 2.4 GHz with HE (overlap)""" + clear_scan_cache(apdev[0]) + force_prev_ap_on_24g(apdev[0]) + + params = {"ssid": "overlapping", + "channel": "6", "ieee80211n": "1"} + hostapd.add_ap(apdev[1], params) + + params = hostapd.wpa2_params(ssid="test-acs", passphrase="12345678") + params['channel'] = '0' + params['ieee80211ax'] = '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)