summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>2015-05-18 08:47:08 +0200
committerDenis Kenzior <denkenz@gmail.com>2015-05-18 09:08:28 -0500
commitf3f3dabfac5c2f73114ac0c52dd76a18674e10bc (patch)
tree010a4662a306d9e4205b54011413f3d74ccd55a1 /test
parent4c0f783f5c6e6dfcbd495b2c12cf4b650f073099 (diff)
downloadofono-f3f3dabfac5c2f73114ac0c52dd76a18674e10bc.tar.bz2
test: Add script for resetting contexts
Diffstat (limited to 'test')
-rw-r--r--test/reset-contexts20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/reset-contexts b/test/reset-contexts
new file mode 100644
index 00000000..16766362
--- /dev/null
+++ b/test/reset-contexts
@@ -0,0 +1,20 @@
+#!/usr/bin/python3
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 2:
+ path = sys.argv[1]
+else:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+
+print("Resetting contexts for SIM on modem %s..." % path)
+cm = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.ConnectionManager')
+
+cm.ResetContexts()