summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-05-18 21:27:13 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-05-18 21:27:13 -0700
commitec03e22b0bd92665aa83c4e27f494ec2df49b4d9 (patch)
tree49c8171e9fbd48c99142d401b17f7da5c55be960 /test
parent01cfb87015bf6f14eadf201792e7e014bb9a9f4a (diff)
downloadconnman-ec03e22b0bd92665aa83c4e27f494ec2df49b4d9.tar.gz
connman-ec03e22b0bd92665aa83c4e27f494ec2df49b4d9.tar.bz2
connman-ec03e22b0bd92665aa83c4e27f494ec2df49b4d9.zip
Add extra test script for listing services
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am3
-rwxr-xr-xtest/list-services27
2 files changed, 29 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 85e8977e..a4ec186a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,6 @@
-EXTRA_DIST = get-state list-profiles list-connections select-connection \
+EXTRA_DIST = get-state list-profiles list-services \
+ list-connections select-connection \
list-devices enable-device disable-device start-scanning \
list-networks select-network disable-network create-network \
set-passphrase set-address set-policy set-priority \
diff --git a/test/list-services b/test/list-services
new file mode 100755
index 00000000..522e122c
--- /dev/null
+++ b/test/list-services
@@ -0,0 +1,27 @@
+#!/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["Services"]:
+ service = dbus.Interface(bus.get_object("org.moblin.connman", path),
+ "org.moblin.connman.Service")
+
+ properties = service.GetProperties()
+
+ print "[ %s ]" % (path)
+
+ for key in properties.keys():
+ if key in ["Strength"]:
+ val = int(properties[key])
+ else:
+ val = str(properties[key])
+ print " %s = %s" % (key, val)
+
+ print