summaryrefslogtreecommitdiff
path: root/test/disable-device
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-02-16 11:52:11 +0100
committerMarcel Holtmann <marcel@holtmann.org>2010-02-16 07:43:23 -0800
commitc9479134d6444c9e9da98ad5bb5ba4891a86d51b (patch)
tree29e4b642844171ce58c757e0da0b9cafb77a51ef /test/disable-device
parent913898ed5da9c9721c90d49bfc64a8e2b1ad4b5c (diff)
downloadconnman-c9479134d6444c9e9da98ad5bb5ba4891a86d51b.tar.gz
connman-c9479134d6444c9e9da98ad5bb5ba4891a86d51b.tar.bz2
connman-c9479134d6444c9e9da98ad5bb5ba4891a86d51b.zip
Update all test scripts using devices properties directly
We need to go through the technology list first in order to access the devices properties.
Diffstat (limited to 'test/disable-device')
-rwxr-xr-xtest/disable-device26
1 files changed, 16 insertions, 10 deletions
diff --git a/test/disable-device b/test/disable-device
index caa954f0..acf962b2 100755
--- a/test/disable-device
+++ b/test/disable-device
@@ -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));