]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Add testcases for interface global properties
authorDan Williams <dcbw@redhat.com>
Wed, 21 Oct 2015 16:00:55 +0000 (11:00 -0500)
committerJouni Malinen <j@w1.fi>
Wed, 28 Oct 2015 21:41:33 +0000 (23:41 +0200)
Signed-off-by: Dan Williams <dcbw@redhat.com>
tests/hwsim/test_dbus.py

index cdfaa1ed84ac9a8022cfe2498e64b33d70ab7017..718d17134c81fcee60ab69fa5dbdc1476fea7053 100644 (file)
@@ -295,6 +295,26 @@ def test_dbus_properties(dev, apdev):
         if "InvalidArgs: invalid message format" not in str(e):
             raise Exception("Unexpected error message: " + str(e))
 
+def test_dbus_set_global_properties(dev, apdev):
+    """D-Bus Get/Set fi.w1.wpa_supplicant1 interface global properties"""
+    (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
+
+    props = [ ('Okc', '0', '1'), ('ModelName', '', 'blahblahblah') ]
+
+    for p in props:
+        res = if_obj.Get(WPAS_DBUS_IFACE, p[0],
+                         dbus_interface=dbus.PROPERTIES_IFACE)
+        if res != p[1]:
+            raise Exception("Unexpected " + p[0] + " value: " + str(res))
+
+        if_obj.Set(WPAS_DBUS_IFACE, p[0], p[2],
+                   dbus_interface=dbus.PROPERTIES_IFACE)
+
+        res = if_obj.Get(WPAS_DBUS_IFACE, p[0],
+                         dbus_interface=dbus.PROPERTIES_IFACE)
+        if res != p[2]:
+            raise Exception("Unexpected " + p[0] + " value after set: " + str(res))
+
 def test_dbus_invalid_method(dev, apdev):
     """D-Bus invalid method"""
     (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
@@ -4735,6 +4755,8 @@ def test_dbus_introspect(dev, apdev):
     logger.info("Initial Introspect: " + str(res))
     if res is None or "Introspectable" not in res or "GroupStarted" not in res:
         raise Exception("Unexpected initial Introspect response: " + str(res))
+    if "FastReauth" not in res or "PassiveScan" not in res:
+        raise Exception("Unexpected initial Introspect response: " + str(res))
 
     with alloc_fail(dev[0], 1, "wpa_dbus_introspect"):
         res2 = if_obj.Introspect(WPAS_DBUS_IFACE,