3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-20 19:12:33 +01:00

test: Switch monitor-iwd to org.freedesktop.DBus.Properties

Other test scripts and autotests don't seem to need changes.
This commit is contained in:
Andrew Zaborowski 2016-09-21 18:51:56 +02:00 committed by Denis Kenzior
parent 0ffec2e481
commit c64534135d

View File

@ -52,9 +52,10 @@ def pretty(d):
return str(d) return str(d)
def property_changed(name, value, path, interface): def properties_changed(interface, changed, invalidated, path):
iface = interface[interface.rfind(".") + 1:] iface = interface[interface.rfind(".") + 1:]
print("{%s} [%s] %s = %s" % (iface, path, name, pretty(value))) for name, value in changed.items():
print("{%s} [%s] %s = %s" % (iface, path, name, pretty(value)))
relevant_ifaces = [ "net.connman.iwd.Device", relevant_ifaces = [ "net.connman.iwd.Device",
"net.connman.iwd.Adapter", "net.connman.iwd.Adapter",
@ -83,11 +84,11 @@ if __name__ == '__main__':
bus = dbus.SystemBus() bus = dbus.SystemBus()
bus.add_signal_receiver(property_changed, bus.add_signal_receiver(properties_changed,
bus_name="net.connman.iwd", bus_name="net.connman.iwd",
signal_name = "PropertyChanged", dbus_interface="org.freedesktop.DBus.Properties",
path_keyword="path", signal_name="PropertiesChanged",
interface_keyword="interface") path_keyword="path")
bus.add_signal_receiver(interfaces_added, bus_name="net.connman.iwd", bus.add_signal_receiver(interfaces_added, bus_name="net.connman.iwd",
dbus_interface="org.freedesktop.DBus.ObjectManager", dbus_interface="org.freedesktop.DBus.ObjectManager",