diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rwxr-xr-x | test/select-connection | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index e4ea64f7..2087e881 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,5 +1,5 @@ -EXTRA_DIST = get-state list-profiles list-connections \ +EXTRA_DIST = get-state list-profiles list-connections select-connection \ list-devices enable-device disable-device start-scanning \ list-networks select-network disable-network create-network \ set-passphrase simple-agent show-introspection \ diff --git a/test/select-connection b/test/select-connection new file mode 100755 index 00000000..34d1f93c --- /dev/null +++ b/test/select-connection @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +properties = manager.GetProperties() + +for path in properties["Connections"]: + connection = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Connection") + + properties = connection.GetProperties() + + if (properties["Default"] == dbus.Boolean(1)): + continue + + print "[ %s ]" % (path) + + connection.SetProperty("Default", dbus.Boolean(1)) |