test: Add list allowed access points script

This commit is contained in:
Nishanth V 2016-04-21 09:21:18 +05:30 committed by Denis Kenzior
parent 72eb1d7b5f
commit 77856af5bd
2 changed files with 27 additions and 1 deletions

View File

@ -749,7 +749,8 @@ test_scripts = test/backtrace \
test/register-operator \
test/set-sms-smsc \
test/set-sms-bearer \
test/get-serving-cell-info
test/get-serving-cell-info \
test/list-allowed-access-points
if TEST
testdir = $(pkglibdir)/test

25
test/list-allowed-access-points Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/python3
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.AllowedAccessPoints" not in properties["Interfaces"]:
continue
allowedAccessPoints = dbus.Interface(bus.get_object('org.ofono',
path), 'org.ofono.AllowedAccessPoints')
apns = allowedAccessPoints.GetAllowedAccessPoints()
print("Allowed Access Points for [ %s ]" % (path))
for apn in apns:
print(" [ %s]" % (apn))
print("")