From: Jouni Malinen Date: Sat, 23 Dec 2023 13:20:24 +0000 (+0200) Subject: tests: Full validation of ACS selecting HT40- channel X-Git-Tag: hostap_2_11~553 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc57ede0105ad1170ff835f31a79fa193e1906c8;p=thirdparty%2Fhostap.git tests: Full validation of ACS selecting HT40- channel Extend the previously used minimal test case with full validation of the selected channel and connection since hostapd now has support for the HT40- case as well. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index fb8f31680..9a5d0b9ed 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -187,11 +187,20 @@ def test_ap_acs_40mhz_minus(dev, apdev): params['acs_num_scans'] = '1' params['chanlist'] = '1 11' hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False) - ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=10) - if not ev: - raise Exception("ACS start timed out") - # HT40- is not currently supported in hostapd ACS, so do not try to connect - # or verify that this operation succeeded. + wait_acs(hapd) + + freq = hapd.get_status_field("freq") + if int(freq) < 2400: + raise Exception("Unexpected frequency") + sec = hapd.get_status_field("secondary_channel") + if int(sec) != -1: + raise Exception("Unexpected secondary_channel: " + sec) + + 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=40 MHz" not in sig: + raise Exception("Station did not report 40 MHz bandwidth") def test_ap_acs_5ghz(dev, apdev): """Automatic channel selection on 5 GHz"""