From ec03e22b0bd92665aa83c4e27f494ec2df49b4d9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 May 2009 21:27:13 -0700 Subject: Add extra test script for listing services --- test/Makefile.am | 3 ++- test/list-services | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 test/list-services 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 -- cgit v1.2.3