From: Marcel Holtmann Date: Thu, 26 Mar 2009 08:22:44 +0000 (-0700) Subject: Fix network selection test scripts X-Git-Tag: 0.14~10 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=71dc77ea6ceaf3d486a2d16305243687f6cdac24;p=connman Fix network selection test scripts --- diff --git a/test/connect-network b/test/connect-network index 8f4f26b..37cf60b 100755 --- a/test/connect-network +++ b/test/connect-network @@ -22,7 +22,7 @@ for path in properties["Devices"]: if properties["Type"] not in ["wifi", "wimax", "bluetooth", "cellular"]: - continue; + continue for path in properties["Networks"]: network = dbus.Interface(bus.get_object("org.moblin.connman", path), @@ -32,6 +32,9 @@ for path in properties["Devices"]: dev = path[path.rfind("/") + 1:] + if "Name" not in properties.keys(): + continue + if dev == sys.argv[1] or properties["Name"] == sys.argv[1]: print "Connecting %s" % (path) network.Connect() diff --git a/test/select-network b/test/select-network index e7c19be..376d9d2 100755 --- a/test/select-network +++ b/test/select-network @@ -21,7 +21,7 @@ for path in properties["Devices"]: properties = device.GetProperties() if (properties["Type"] != "wifi" and properties["Type"] != "wimax"): - continue; + continue print "[ %s ]" % (path) @@ -31,7 +31,7 @@ for path in properties["Devices"]: properties = network.GetProperties() - if "Name" not in properties.keys: + if "Name" not in properties.keys(): continue if (properties["Connected"] == dbus.Boolean(1)):