summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-08-07 10:23:13 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-08-07 10:23:13 -0700
commit15a9b7abf662910638662ffe11cf880f91baee12 (patch)
treebd63bf35881d137f428aced73f25404e71172fb0 /test
parentd1a77982c2fb935a2e78b5582687c4ab40ff4a4f (diff)
downloadconnman-15a9b7abf662910638662ffe11cf880f91baee12.tar.gz
connman-15a9b7abf662910638662ffe11cf880f91baee12.tar.bz2
connman-15a9b7abf662910638662ffe11cf880f91baee12.zip
Add support for changing the AutoConnect value of services
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-connman32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test-connman b/test/test-connman
index dff1a257..f82150f0 100755
--- a/test/test-connman
+++ b/test/test-connman
@@ -14,6 +14,7 @@ if len(sys.argv) < 2:
print " state"
print " services"
print " passphrase <service> [passphrase]"
+ print " autoconnect <service> [autoconnect]"
print " connect <service>"
print " disconnect <service>"
print " remove <service>"
@@ -187,6 +188,37 @@ elif sys.argv[1] in ["passphrase", "pass"]:
print "Passphrase for %s is %s" % (name, passphrase)
+elif sys.argv[1] in ["autoconnect", "autoconn"]:
+ if (len(sys.argv) < 3):
+ print "Need at least service parameter"
+ sys.exit(1)
+
+ path = "/profile/default/" + sys.argv[2]
+
+ service = dbus.Interface(bus.get_object("org.moblin.connman", path),
+ "org.moblin.connman.Service")
+
+ if (len(sys.argv) > 3):
+ autoconnect = dbus.Boolean(sys.argv[3])
+
+ service.SetProperty("AutoConnect", autoconnect);
+
+ print "Auto connect %s for %s" % (autoconnect, sys.argv[2])
+ else:
+ properties = service.GetProperties()
+
+ if "Name" in properties.keys():
+ name = properties["Name"]
+ else:
+ name = "{" + properties["Type"] + "}"
+
+ if "AutoConnect" in properties.keys():
+ autoconnect = properties["AutoConnect"]
+ else:
+ autoconnect = dbus.Boolean(0)
+
+ print "Auto connect %s for %s" % (autoconnect, name)
+
elif sys.argv[1] in ["connect", "conn"]:
if (len(sys.argv) < 3):
print "Need at least service parameter"