Add test scripts for radio technology preference

This commit is contained in:
Marcel Holtmann 2010-06-06 11:11:57 -07:00
parent 63d1efdf7f
commit 71335f3d9c
3 changed files with 47 additions and 1 deletions

View File

@ -333,7 +333,9 @@ test_scripts = test/activate-context \
test/test-ussd \
test/test-voicecall \
test/offline-modem \
test/online-modem
test/online-modem \
test/get-tech-preference \
test/set-tech-preference
if TEST
testdir = $(pkglibdir)/test

20
test/get-tech-preference Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/python
import dbus, 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')
properties = manager.GetProperties()
path = properties["Modems"][0]
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.RadioSettings')
properties = radiosettings.GetProperties()
print "Technology preference: %s" % (properties["TechnologyPreference"])

24
test/set-tech-preference Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/python
import dbus
import sys
bus = dbus.SystemBus()
if len(sys.argv) == 3:
path = sys.argv[1]
tech = sys.argv[2]
elif len(sys.argv) == 2:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
properties = manager.GetProperties()
path = properties["Modems"][0]
tech = sys.argv[1]
else:
print "%s [PATH] technology" % (sys.argv[0])
print "Setting technology preference for modem %s..." % path
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.RadioSettings')
radiosettings.SetProperty("TechnologyPreference", tech);