Skip to contentSkip to conversation

test: Add list allowed access points script

PATCH In review Nishanth V 1 participant 1 message Apr 21, 2016 Kbuild

lore
Share & tools
lore

Nishanth V

author
#0 lore raw

PATCH 4/4 test: Add list allowed access points script

---
 Makefile.am                     |  3 ++-
 test/list-allowed-access-points | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100755 test/list-allowed-access-points
Makefile.am +2 -1
index c788149..5215b2e 100644
@@ -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
test/list-allowed-access-points new file +25 -0
new file mode 100755
index 0000000..c7bb50c
@@ -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("")
Signature · 1 line
1.9.1