test: Add script for retrieving clock properties
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 18 Apr 2011 19:33:23 +0000 (12:33 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 18 Apr 2011 19:33:23 +0000 (12:33 -0700)
test/test-clock [new file with mode: 0755]

diff --git a/test/test-clock b/test/test-clock
new file mode 100755 (executable)
index 0000000..e9b76fc
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+clock = dbus.Interface(bus.get_object("net.connman", "/"),
+                                       "net.connman.Clock")
+
+properties = clock.GetProperties()
+
+for key in properties.keys():
+       if key in ["Timeservers"]:
+               list = ""
+               for val in properties[key]:
+                       list = list + val + " "
+               print "%s = [ %s]" % (key, list)
+       else:
+               print "%s = %s" % (key, properties[key])