Add test script for setting CBS topics

This commit is contained in:
Marcel Holtmann 2010-06-09 18:58:38 -07:00
parent 118759d5ba
commit 86caf654de
2 changed files with 25 additions and 0 deletions

View File

@ -337,6 +337,7 @@ test_scripts = test/activate-context \
test/online-modem \
test/get-tech-preference \
test/set-tech-preference \
test/set-cbs-topics \
test/enable-cbs
if TEST

24
test/set-cbs-topics 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]
topics = 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]
topics = sys.argv[1]
else:
print "%s [PATH] topics" % (sys.argv[0])
print "Setting cell broadcast topics for modem %s..." % path
cbs = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.CbsManager')
cbs.SetProperty("Topics", topics);