mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
test: Update python scripts with dbus interface changes
This commit is contained in:
parent
ab1319a9d5
commit
ea6db49e8d
@ -6,31 +6,37 @@ import dbus
|
|||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
manager = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
|
manager = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
|
||||||
"net.connman.iwd.Manager")
|
"org.freedesktop.DBus.ObjectManager")
|
||||||
devices = manager.GetDevices()
|
objects = manager.GetManagedObjects()
|
||||||
|
|
||||||
|
for path in objects:
|
||||||
|
if 'net.connman.iwd.Device' not in objects[path]:
|
||||||
|
continue
|
||||||
|
|
||||||
|
device = objects[path]['net.connman.iwd.Device']
|
||||||
|
|
||||||
for path in devices:
|
|
||||||
print("[ %s ]" % path)
|
print("[ %s ]" % path)
|
||||||
properties = devices[path]
|
|
||||||
|
|
||||||
for key in properties.keys():
|
for key in device.keys():
|
||||||
val = properties[key]
|
val = device[key]
|
||||||
print(" %s = %s" % (key, val))
|
print(" %s = %s" % (key, val))
|
||||||
|
|
||||||
print(" Networks:")
|
print(" Networks:")
|
||||||
|
|
||||||
device = dbus.Interface(bus.get_object("net.connman.iwd", path),
|
for path2 in objects:
|
||||||
"net.connman.iwd.Device")
|
if not path2.startswith(path) or \
|
||||||
networks = device.GetNetworks()
|
'net.connman.iwd.Network' not in objects[path2]:
|
||||||
for path in networks:
|
continue
|
||||||
print(" [ %s ]" % path)
|
|
||||||
properties = networks[path]
|
|
||||||
|
|
||||||
for key in properties.keys():
|
network = objects[path2]['net.connman.iwd.Network']
|
||||||
|
|
||||||
|
print(" [ %s ]" % path2)
|
||||||
|
|
||||||
|
for key in network.keys():
|
||||||
if key in ["SSID"]:
|
if key in ["SSID"]:
|
||||||
val = properties[key]
|
val = network[key]
|
||||||
val = "".join(map(chr, val))
|
val = "".join(map(chr, val))
|
||||||
else:
|
else:
|
||||||
val = properties[key]
|
val = network[key]
|
||||||
|
|
||||||
print(" %s = %s" % (key, val))
|
print(" %s = %s" % (key, val))
|
||||||
|
@ -55,7 +55,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
manager = dbus.Interface(bus.get_object('net.connman.iwd', "/"),
|
manager = dbus.Interface(bus.get_object('net.connman.iwd', "/"),
|
||||||
'net.connman.iwd.Manager')
|
'net.connman.iwd.AgentManager')
|
||||||
|
|
||||||
path = "/test/agent/" + str(randrange(100))
|
path = "/test/agent/" + str(randrange(100))
|
||||||
object = Agent(bus, path)
|
object = Agent(bus, path)
|
||||||
|
Loading…
Reference in New Issue
Block a user