summaryrefslogtreecommitdiffstats
path: root/test/remove-contexts
diff options
context:
space:
mode:
Diffstat (limited to 'test/remove-contexts')
-rwxr-xr-xtest/remove-contexts28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/remove-contexts b/test/remove-contexts
new file mode 100755
index 00000000..181c6fcd
--- /dev/null
+++ b/test/remove-contexts
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+properties = manager.GetProperties()
+
+for path in properties["Modems"]:
+ modem = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.Modem')
+
+ properties = modem.GetProperties()
+
+ if "org.ofono.DataConnectionManager" not in properties["Interfaces"]:
+ continue
+
+ connmgr = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.DataConnectionManager')
+
+ properties = connmgr.GetProperties()
+
+ for path in properties["PrimaryContexts"]:
+ connmgr.RemoveContext(path)
+ print"Removed: [ %s ]" % (path)