test: Update activate-context to the new API

This commit is contained in:
Denis Kenzior 2010-08-19 13:23:34 -05:00
parent 256e01c8c4
commit b4c1938d8a
1 changed files with 8 additions and 8 deletions

View File

@ -16,24 +16,24 @@ for path in properties["Modems"]:
properties = modem.GetProperties()
if "org.ofono.DataConnectionManager" not in properties["Interfaces"]:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
connmgr = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.DataConnectionManager')
connman = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionManager')
properties = connmgr.GetProperties()
contexts = connman.GetContexts()
if (properties["PrimaryContexts"] == []):
if (len(contexts) == 0):
print "No context available"
sys.exit(1)
connmgr.SetProperty("Powered", dbus.Boolean(1))
connman.SetProperty("Powered", dbus.Boolean(1))
path = properties["PrimaryContexts"][0]
path = contexts[0][0]
context = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.PrimaryDataContext')
'org.ofono.ConnectionContext')
try:
context.SetProperty("Active", dbus.Boolean(1))