From 1a15548799d4b1836b5741902efa2332a25b47ed Mon Sep 17 00:00:00 2001 From: "Gustavo F. Padovan" Date: Wed, 22 Dec 2010 16:51:05 -0200 Subject: [PATCH] modem: Add test script for the Lockdown property --- Makefile.am | 1 + test/lockdown-modem | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 test/lockdown-modem diff --git a/Makefile.am b/Makefile.am index 252b5da4..94d5c095 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/test/lockdown-modem b/test/lockdown-modem new file mode 100755 index 00000000..5d981546 --- /dev/null +++ b/test/lockdown-modem @@ -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))