From f7088384e8bd70cbac2a16bb3d8ae7d02fbcfa2a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 28 Jan 2016 22:05:43 -0600 Subject: [PATCH] test: Add register-auto --- Makefile.am | 3 ++- test/register-auto | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 test/register-auto diff --git a/Makefile.am b/Makefile.am index 962ead9e..a172037b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -729,7 +729,8 @@ test_scripts = test/backtrace \ test/hangup-call \ test/display-icon \ test/set-msisdn \ - test/set-ddr + test/set-ddr \ + test/register-auto if TEST testdir = $(pkglibdir)/test diff --git a/test/register-auto b/test/register-auto new file mode 100755 index 00000000..5da0b68c --- /dev/null +++ b/test/register-auto @@ -0,0 +1,18 @@ +#!/usr/bin/python3 + +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] + +netreg = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.NetworkRegistration') +netreg.Register()