]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Full validation of ACS selecting HT40- channel
authorJouni Malinen <j@w1.fi>
Sat, 23 Dec 2023 13:20:24 +0000 (15:20 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 23 Dec 2023 13:20:24 +0000 (15:20 +0200)
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 <j@w1.fi>
tests/hwsim/test_ap_acs.py

index fb8f316808dfffdd75cdedde90a68568624867d7..9a5d0b9ed683d46cc5f0024b10be5d2d84af2a70 100644 (file)
@@ -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"""