mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-01 16:22:44 +01:00
test: Add a KnownNetworks test script
This commit is contained in:
parent
d08874f842
commit
d371c287bb
21
test/list-known-networks
Executable file
21
test/list-known-networks
Executable 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))
|
Loading…
Reference in New Issue
Block a user