]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Scanning frequencies from network blocks
authorJouni Malinen <jouni.malinen@oss.qualcomm.com>
Fri, 24 Oct 2025 12:33:13 +0000 (15:33 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 24 Oct 2025 12:33:13 +0000 (15:33 +0300)
These test cases are mainly to allow manual checking of scanning
frequencies when wpa_supplicant configuration includes two network
profiles and only the selected one has a single scan_freq value.

Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
tests/hwsim/test_dbus.py
tests/hwsim/test_scan.py

index 0f854b0df1e0714360857bc8047cc04df1ff0573..b225f24c57234f4236b7768b2161be9362c05237 100644 (file)
@@ -6754,3 +6754,23 @@ def test_dbus_nan_usd_publish_followup(dev, apdev):
     with TestDbusNANUSD(bus) as t:
         if not t.success():
             raise Exception("Expected signals not seen")
+
+def test_dbus_scan_freq_network(dev, apdev):
+    """D-Bus scanning channels based on network profiles"""
+    (bus, wpas_obj, path, if_obj) = prepare_dbus(dev[0])
+    iface = dbus.Interface(if_obj, WPAS_DBUS_IFACE)
+
+    hostapd.add_ap(apdev[0], {"ssid": "test-scan"})
+
+    args = dbus.Dictionary({'ssid': "foo",
+                            'key_mgmt': 'NONE'},
+                           signature='sv')
+    netw0 = iface.AddNetwork(args)
+
+    args = dbus.Dictionary({'ssid': "test-scan",
+                            'key_mgmt': 'NONE',
+                            'scan_freq': 2412},
+                           signature='sv')
+    netw = iface.AddNetwork(args)
+    iface.SelectNetwork(netw)
+    dev[0].wait_connected()
index c51eef770f3bfba1e6f452d083c74a61ffca5c64..9a84335a33cdef674a01fe8c5513d20a68fc04f7 100644 (file)
@@ -2044,3 +2044,21 @@ def test_scan_short_ssid_list(dev, apdev):
 
     if not found:
         raise Exception("AP not found in scan results")
+
+def test_scan_freq_network(dev, apdev):
+    """Scanning channels based on network profiles"""
+    hostapd.add_ap(apdev[0], {"ssid": "test-scan"})
+
+    id = dev[0].add_network()
+    dev[0].set_network_quoted(id, "ssid", "foo")
+    dev[0].set_network(id, "key_mgmt", "NONE")
+    dev[0].set_network(id, "disabled", "0")
+
+    id2 = dev[0].add_network()
+    dev[0].set_network_quoted(id2, "ssid", "test-scan")
+    dev[0].set_network(id2, "key_mgmt", "NONE")
+    dev[0].set_network(id2, "disabled", "0")
+    dev[0].set_network(id2, "scan_freq", "2412")
+
+    dev[0].select_network(id2)
+    dev[0].wait_connected()