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

test: Add a KnownNetworks test script

This commit is contained in:
Andrew Zaborowski 2016-07-14 02:38:08 +02:00 committed by Denis Kenzior
parent d08874f842
commit d371c287bb

21
test/list-known-networks Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/python3
import sys
import dbus
bus = dbus.SystemBus()
kn = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
"net.connman.iwd.KnownNetworks")
if len(sys.argv) >= 4 and sys.argv[1] == 'forget':
kn.ForgetNetwork(sys.argv[2], sys.argv[3])
print('Known Networks:')
for network in kn.ListKnownNetworks():
print("[ %s ]" % network['Name'])
for key in network:
val = network[key]
print(" %s = %s" % (key, val))