summaryrefslogtreecommitdiff
path: root/test/disable-tethering
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-02-02 18:35:36 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-02-02 18:35:36 +0100
commit84ca3da23a5d84b16ec13d2f56ff49be67b1669c (patch)
tree4e5e82c585b7c1cc25408000ec0f775af44e771e /test/disable-tethering
parent868be1a1f64415ba7126922b89420bea82243303 (diff)
downloadconnman-84ca3da23a5d84b16ec13d2f56ff49be67b1669c.tar.gz
connman-84ca3da23a5d84b16ec13d2f56ff49be67b1669c.tar.bz2
connman-84ca3da23a5d84b16ec13d2f56ff49be67b1669c.zip
test: Handle new tethering properties
Diffstat (limited to 'test/disable-tethering')
-rwxr-xr-xtest/disable-tethering24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/disable-tethering b/test/disable-tethering
index 01cc96ca..2dabd839 100755
--- a/test/disable-tethering
+++ b/test/disable-tethering
@@ -1,10 +1,32 @@
#!/usr/bin/python
+import sys
import dbus
+if (len(sys.argv) < 2):
+ print "Usage: %s type" % (sys.argv[0])
+
+print "Disabling %s tethering" % (sys.argv[1])
+
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('net.connman', "/"),
'net.connman.Manager')
-manager.SetProperty("Tethering", dbus.Boolean(0));
+def technology_disable_tethering(path, tech_type):
+ tech = dbus.Interface(bus.get_object("net.connman", path),
+ "net.connman.Technology")
+
+ properties = tech.GetProperties()
+
+ for key in properties.keys():
+ if key in ["Type"]:
+ if properties[key] == tech_type:
+ tech.SetProperty("Tethering", dbus.Boolean(0))
+
+properties = manager.GetProperties()
+
+for key in properties.keys():
+ if key in ["Technologies"]:
+ for path in properties[key]:
+ technology_disable_tethering(path, sys.argv[1])