summaryrefslogtreecommitdiffstats
path: root/test/remove-contexts
diff options
context:
space:
mode:
authorAki Niemi <aki.niemi@nokia.com>2010-04-16 22:42:27 +0300
committerAki Niemi <aki.niemi@nokia.com>2010-04-20 14:16:33 +0300
commit1e75518c30861a39be8f47295f413590583ff3f3 (patch)
tree0a9f7b1ccc42b7678d4f79a6aba07d0b3406d355 /test/remove-contexts
parent144b30ac6d0f2267d0ddc7fea49a72f0d7b107a2 (diff)
downloadofono-1e75518c30861a39be8f47295f413590583ff3f3.tar.bz2
Improve GPRS test scripts
Catch some errors and add a script for removing contexts.
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)