test: add deactivate-all

Uses ConnectionManager DeactivateAll
This commit is contained in:
Denis Kenzior 2010-10-25 15:48:55 -05:00
parent 180f765ebe
commit 42dfbc450b
2 changed files with 22 additions and 1 deletions

View File

@ -409,7 +409,8 @@ test_scripts = test/backtrace \
test/unlock-pin \
test/enable-gprs \
test/disable-gprs \
test/get-icon
test/get-icon \
test/deactivate-all
if TEST
testdir = $(pkglibdir)/test

20
test/deactivate-all Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/python
import sys
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
modems = manager.GetModems()
for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
connman = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionManager')
connman.DeactivateAll()