test: simple-agent support for ReportError method call
[framework/connectivity/connman.git] / test / list-profiles
index 4774114..b9b9103 100755 (executable)
@@ -4,19 +4,31 @@ import dbus
 
 bus = dbus.SystemBus()
 
-manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
-                                       "org.moblin.connman.Manager")
+manager = dbus.Interface(bus.get_object("net.connman", "/"),
+                                       "net.connman.Manager")
 
 properties = manager.GetProperties()
 
+active = properties["ActiveProfile"]
+
 for path in properties["Profiles"]:
-       print "[ %s ]" % (path)
+       if (active == path):
+               print "[ %s ]  <== active" % (path)
+       else:
+               print "[ %s ]" % (path)
 
-       profile = dbus.Interface(bus.get_object("org.moblin.connman", path),
-                                               "org.moblin.connman.Profile")
+       profile = dbus.Interface(bus.get_object("net.connman", path),
+                                               "net.connman.Profile")
 
        properties = profile.GetProperties()
        for key in properties.keys():
-               print "    %s = %s" % (key, properties[key])
+               if key in ["Services"]:
+                       list = ""
+                       for path in properties["Services"]:
+                               val = str(path)
+                               list = list + val[val.rfind("/") + 1:] + " "
+                       print "    Services = [ %s]" % (list)
+               else:
+                       print "    %s = %s" % (key, properties[key])
 
        print