Update all test scripts using devices properties directly
[framework/connectivity/connman.git] / test / disable-device
index caa954f..acf962b 100755 (executable)
@@ -14,18 +14,24 @@ manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
 
 properties = manager.GetProperties()
 
-for path in properties["Devices"]:
-       device = dbus.Interface(bus.get_object('org.moblin.connman', path),
-                                               'org.moblin.connman.Device')
+for path in properties["Technologies"]:
+       technology = dbus.Interface(bus.get_object("org.moblin.connman", path),
+                                               "org.moblin.connman.Technology")
 
-       properties = device.GetProperties()
+       properties = technology.GetProperties()
 
-       if "Interface" not in properties.keys():
-               continue
+       for path in properties["Devices"]:
+               device = dbus.Interface(bus.get_object('org.moblin.connman', path),
+                                                       'org.moblin.connman.Device')
 
-       if properties["Interface"] != sys.argv[1]:
-               continue
+               properties = device.GetProperties()
 
-       print "Disabling device %s" % (path)
+               if "Interface" not in properties.keys():
+                       continue
 
-       device.SetProperty("Powered", dbus.Boolean(0));
+               if properties["Interface"] != sys.argv[1]:
+                       continue
+
+               print "Disabling device %s" % (path)
+
+               device.SetProperty("Powered", dbus.Boolean(0));