modem: Add test script for the Lockdown property

This commit is contained in:
Gustavo F. Padovan 2010-12-22 16:51:05 -02:00 committed by Denis Kenzior
parent 6046d94cb8
commit 1a15548799
2 changed files with 26 additions and 0 deletions

View File

@ -428,6 +428,7 @@ test_scripts = test/backtrace \
test/set-tty \
test/set-gsm-band \
test/set-umts-band
test/lockdown-modem
if TEST
testdir = $(pkglibdir)/test

25
test/lockdown-modem Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/python
import dbus
import 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')
modems = manager.GetModems()
path = modems[0][0]
print "Locking and disconnecting modem %s..." % path
modem = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.Modem')
modem.SetProperty("Lockdown", dbus.Boolean(1))
print "press ENTER to unlock the modem %s" % path
sys.stdin.readline()
modem.SetProperty("Lockdown", dbus.Boolean(0))