mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 17:59:25 +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()
|
||||
|
||||
manager = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
|
||||
"net.connman.iwd.Manager")
|
||||
devices = manager.GetDevices()
|
||||
"org.freedesktop.DBus.ObjectManager")
|
||||
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)
|
||||
properties = devices[path]
|
||||
|
||||
for key in properties.keys():
|
||||
val = properties[key]
|
||||
for key in device.keys():
|
||||
val = device[key]
|
||||
print(" %s = %s" % (key, val))
|
||||
|
||||
print(" Networks:")
|
||||
|
||||
device = dbus.Interface(bus.get_object("net.connman.iwd", path),
|
||||
"net.connman.iwd.Device")
|
||||
networks = device.GetNetworks()
|
||||
for path in networks:
|
||||
print(" [ %s ]" % path)
|
||||
properties = networks[path]
|
||||
for path2 in objects:
|
||||
if not path2.startswith(path) or \
|
||||
'net.connman.iwd.Network' not in objects[path2]:
|
||||
continue
|
||||
|
||||
for key in properties.keys():
|
||||
network = objects[path2]['net.connman.iwd.Network']
|
||||
|
||||
print(" [ %s ]" % path2)
|
||||
|
||||
for key in network.keys():
|
||||
if key in ["SSID"]:
|
||||
val = properties[key]
|
||||
val = network[key]
|
||||
val = "".join(map(chr, val))
|
||||
else:
|
||||
val = properties[key]
|
||||
val = network[key]
|
||||
|
||||
print(" %s = %s" % (key, val))
|
||||
|
@ -55,7 +55,7 @@ if __name__ == '__main__':
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
manager = dbus.Interface(bus.get_object('net.connman.iwd', "/"),
|
||||
'net.connman.iwd.Manager')
|
||||
'net.connman.iwd.AgentManager')
|
||||
|
||||
path = "/test/agent/" + str(randrange(100))
|
||||
object = Agent(bus, path)
|
||||
|
Loading…
Reference in New Issue
Block a user