test: Add test script to set sms alphabet

This commit is contained in:
Nandini Rebello 2018-10-01 15:32:56 +05:30 committed by Denis Kenzior
parent a2168cd136
commit 638583522e
2 changed files with 27 additions and 1 deletions

View File

@ -825,7 +825,8 @@ test_scripts = test/backtrace \
test/test-serving-cell-info \
test/ims-register \
test/ims-unregister \
test/list-applications
test/list-applications \
test/set-sms-alphabet
if TEST

25
test/set-sms-alphabet Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/python3
import dbus
import sys
bus = dbus.SystemBus()
if len(sys.argv) == 3:
path = sys.argv[1]
alphabet = sys.argv[2]
elif len(sys.argv) == 2:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
modems = manager.GetModems()
path = modems[0][0]
alphabet = sys.argv[1]
else:
print("%s [PATH] turkish|spanish|portuguese|bengali|gujarati" % (sys.argv[0]))
sys.exit(1)
print("Setting alphabet for modem %s..." % path)
sms = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.MessageManager')
sms.SetProperty("Alphabet", dbus.String(alphabet));