summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@linux.intel.com>2012-04-05 10:20:21 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-04-05 15:56:29 (GMT)
commit1f452014fedfe317013245a223084037f9f2280e (patch)
tree4f7b72f40b79b720d845a77747931757058481b5 /test
parent9403e2f65c606a9e171e975a37d3ae62589c1f7d (diff)
downloadconnman-1f452014fedfe317013245a223084037f9f2280e.zip
connman-1f452014fedfe317013245a223084037f9f2280e.tar.gz
connman-1f452014fedfe317013245a223084037f9f2280e.tar.bz2
test: Add set-timeservers
Add script to modify service Timeservers.Configuration property.
Diffstat (limited to 'test')
-rwxr-xr-xtest/set-timeservers20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/set-timeservers b/test/set-timeservers
new file mode 100755
index 0000000..19cc938
--- /dev/null
+++ b/test/set-timeservers
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 2):
+ print "Usage: %s <service> [timeserver*]" % (sys.argv[0])
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+path = "/net/connman/service/" + sys.argv[1]
+service = dbus.Interface(bus.get_object('net.connman', path),
+ 'net.connman.Service')
+
+properties = service.GetProperties()
+
+print "Setting timeserver to %s" % (sys.argv[2:])
+
+service.SetProperty("Timeservers.Configuration",
+ dbus.Array(sys.argv[2:], signature=dbus.Signature('s')))