diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-02-16 11:52:11 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-02-16 07:43:23 -0800 |
commit | c9479134d6444c9e9da98ad5bb5ba4891a86d51b (patch) | |
tree | 29e4b642844171ce58c757e0da0b9cafb77a51ef /test/disable-device | |
parent | 913898ed5da9c9721c90d49bfc64a8e2b1ad4b5c (diff) | |
download | connman-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-x | test/disable-device | 26 |
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)); |