]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Regression test for D-Bus setting scan_freq and freq_list
authorJouni Malinen <j@w1.fi>
Thu, 27 Aug 2015 21:13:53 +0000 (00:13 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 27 Aug 2015 21:20:30 +0000 (00:20 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_dbus.py
tests/hwsim/test_dbus_old.py

index 29275b70a96cb2843b39e651bb6a4aa35b060667..273ed503118c9af923bd8dc9bb1665e7885f573d 100644 (file)
@@ -1500,6 +1500,25 @@ def test_dbus_network(dev, apdev):
                              'scan_freq': dbus.UInt32(2412) },
                            signature='sv')
     netw = iface.AddNetwork(args)
+    id = int(dev[0].list_networks()[0]['id'])
+    val = dev[0].get_network(id, "scan_freq")
+    if val != "2412":
+        raise Exception("Invalid scan_freq value: " + str(val))
+    iface.RemoveNetwork(netw)
+
+    args = dbus.Dictionary({ 'ssid': "foo",
+                             'key_mgmt': 'NONE',
+                             'scan_freq': "2412 2432",
+                             'freq_list': "2412 2417 2432" },
+                           signature='sv')
+    netw = iface.AddNetwork(args)
+    id = int(dev[0].list_networks()[0]['id'])
+    val = dev[0].get_network(id, "scan_freq")
+    if val != "2412 2432":
+        raise Exception("Invalid scan_freq value (2): " + str(val))
+    val = dev[0].get_network(id, "freq_list")
+    if val != "2412 2417 2432":
+        raise Exception("Invalid freq_list value: " + str(val))
     iface.RemoveNetwork(netw)
     try:
         iface.RemoveNetwork(netw)
index 874d411286b67526472d8b720e6564d25c1ddd0f..c7c7e19a0763a315b6e76b73bba422dd376f1e82 100644 (file)
@@ -467,6 +467,20 @@ def test_dbus_old_connect(dev, apdev):
                                'scan_freq': dbus.UInt32(2412) },
                              signature='sv')
     netw_obj.set(params, dbus_interface=WPAS_DBUS_OLD_NETWORK)
+    id = int(dev[0].list_networks()[0]['id'])
+    val = dev[0].get_network(id, "scan_freq")
+    if val != "2412":
+        raise Exception("Invalid scan_freq value: " + str(val))
+    params = dbus.Dictionary({ 'scan_freq': "2412 2432",
+                               'freq_list': "2412 2417 2432" },
+                             signature='sv')
+    netw_obj.set(params, dbus_interface=WPAS_DBUS_OLD_NETWORK)
+    val = dev[0].get_network(id, "scan_freq")
+    if val != "2412 2432":
+        raise Exception("Invalid scan_freq value (2): " + str(val))
+    val = dev[0].get_network(id, "freq_list")
+    if val != "2412 2417 2432":
+        raise Exception("Invalid freq_list value: " + str(val))
     if_obj.removeNetwork(npath, dbus_interface=WPAS_DBUS_OLD_IFACE)
 
     class TestDbusConnect(TestDbus):