summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rwxr-xr-xtest/set-roaming-allowed27
2 files changed, 28 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 7c84a90f..6c56459d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -368,6 +368,7 @@ test_scripts = test/backtrace \
test/enter-pin \
test/hangup-all \
test/hangup-active \
+ test/set-roaming-allowed \
test/set-context \
test/list-contexts \
test/list-modems \
diff --git a/test/set-roaming-allowed b/test/set-roaming-allowed
new file mode 100755
index 00000000..f7f9c9d3
--- /dev/null
+++ b/test/set-roaming-allowed
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+
+for path, properties in modems:
+ if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
+ continue
+
+ connman = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.ConnectionManager')
+
+ if len(sys.argv) > 1:
+ allowed = dbus.Boolean(int(sys.argv[1]))
+ else:
+ allowed = dbus.Boolean(1)
+
+ connman.SetProperty("RoamingAllowed", allowed)
+
+ print "Setting %s to RoamingAllowed=%d" % (path, allowed)