summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-17 14:08:57 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-20 12:39:15 +0300
commit912925f05d5da4922f76e8a55f095107fb50f6a6 (patch)
tree2f8f65d18095a2f8a58eafe7817c1041859857ce /test
parentdfda72b08374a1095756c0212162618ed56586b6 (diff)
downloadconnman-912925f05d5da4922f76e8a55f095107fb50f6a6.tar.gz
connman-912925f05d5da4922f76e8a55f095107fb50f6a6.tar.bz2
connman-912925f05d5da4922f76e8a55f095107fb50f6a6.zip
test: Add test script for Clock API
Diffstat (limited to 'test')
-rwxr-xr-xtest/set-clock32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/set-clock b/test/set-clock
new file mode 100755
index 00000000..a9db3e32
--- /dev/null
+++ b/test/set-clock
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+def print_usage():
+ print "Usage: %s TimeUpdates|TimezoneUpdates manual|auto" % (sys.argv[0])
+ sys.exit(1)
+
+
+def make_variant(string):
+ return dbus.String(string, variant_level=1)
+
+
+if (len(sys.argv) != 3):
+ print_usage()
+
+if (sys.argv[1] != "TimeUpdates" and sys.argv[1] != "TimezoneUpdates"):
+ print_usage()
+
+if (sys.argv[2] != "manual" and sys.argv[2] != "auto"):
+ print_usage()
+
+bus = dbus.SystemBus()
+
+clock = dbus.Interface(bus.get_object('net.connman', '/'),
+ 'net.connman.Clock')
+
+print "Setting %s to %s" % (sys.argv[1], sys.argv[2])
+
+clock.SetProperty(sys.argv[1], make_variant(sys.argv[2]),
+ signature=dbus.Signature('sv'))