summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-08-19 13:24:09 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-08-19 14:20:06 -0500
commitb775c434d9e4f2ab6e8b4005343dfc9076b8ea37 (patch)
tree8a86c21fbfcfc33ebdb63582af444fc65d07a9ab
parentb4c1938d8a0788c64b923aa0bc112b63cf15e6df (diff)
downloadofono-b775c434d9e4f2ab6e8b4005343dfc9076b8ea37.tar.bz2
test: update create-context to the new API
-rwxr-xr-xtest/create-context16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/create-context b/test/create-context
index 4523c3ac..20f2be59 100755
--- a/test/create-context
+++ b/test/create-context
@@ -16,21 +16,21 @@ 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"] == []):
- path = connmgr.CreateContext("Internet access", "internet")
+ if (len(contexts) == 0):
+ path = connman.AddContext("internet")
else:
- 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("AccessPointName", sys.argv[1])