mirror of git://git.sysmocom.de/ofono
test: Add script for enabling/disabling RoamingAllowed property
This commit is contained in:
parent
907e14e4ae
commit
da54398fa5
|
@ -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 \
|
||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue