summaryrefslogtreecommitdiffstats
path: root/test/disable-call-forwarding
diff options
context:
space:
mode:
authorJarko Poutiainen <jarko.poutiainen@tieto.com>2011-01-14 10:24:29 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-01-14 11:30:37 +0100
commitab55a635e1a533626ac1b7e7d6dac7ff98e28773 (patch)
tree7bc74c486c41cab2a4d3ce449f2dac5eb0f8a708 /test/disable-call-forwarding
parentd8f7f53096fb342e4af5b0efddfce304e290437b (diff)
downloadofono-ab55a635e1a533626ac1b7e7d6dac7ff98e28773.tar.bz2
test: add disable-call-forwarding
Diffstat (limited to 'test/disable-call-forwarding')
-rwxr-xr-xtest/disable-call-forwarding53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/disable-call-forwarding b/test/disable-call-forwarding
new file mode 100755
index 00000000..ca0ba903
--- /dev/null
+++ b/test/disable-call-forwarding
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+
+import sys
+import gobject
+
+import dbus
+import dbus.mainloop.glib
+
+def property_changed(property, value):
+ if len(value.__str__()) > 0:
+ print "CF property %s changed to %s" % (property, value)
+ else:
+ print "CF property %s changed to disabled" % (property)
+
+ if canexit:
+ mainloop.quit();
+
+if __name__ == "__main__":
+ if len(sys.argv) < 2:
+ print "Usage: %s <type>" % (sys.argv[0])
+ print "Type can be: all, conditional"
+ sys.exit(1)
+
+ canexit = False
+
+ type = sys.argv[1]
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+ modems = manager.GetModems()
+
+ cf = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
+ 'org.ofono.CallForwarding')
+
+ cf.connect_to_signal("PropertyChanged", property_changed)
+
+ try:
+ cf.DisableAll(type, timeout = 100)
+ except dbus.DBusException, e:
+ print "Unable to DisableAll", e
+ sys.exit(1);
+
+ print "DisableAll successful"
+
+ canexit = True
+
+ mainloop = gobject.MainLoop()
+ mainloop.run()