diff options
Diffstat (limited to 'test/remove-contexts')
-rwxr-xr-x | test/remove-contexts | 28 |
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) |