test: Fix tethering scripts
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 21 Feb 2011 20:26:19 +0000 (21:26 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 21 Feb 2011 20:26:19 +0000 (21:26 +0100)
Check for the enabling/disabling python return values.

test/disable-tethering
test/enable-tethering

index e275b2b..8743523 100755 (executable)
@@ -24,6 +24,8 @@ def technology_disable_tethering(path, tech_type):
                                tech.SetProperty("Tethering", dbus.Boolean(0))
 
                                return tech_type
+                       else:
+                               return None
 
 properties = manager.GetProperties()
 
@@ -31,6 +33,8 @@ for key in properties.keys():
        if key in ["Technologies"]:
                for path in properties[key]:
                        tech = technology_disable_tethering(path, sys.argv[1])
+                       if tech != None:
+                               break;
 
 if tech == None:
        print "Failed to disable %s tethering" % (sys.argv[1])
index 6bb1a9a..cdb037f 100755 (executable)
@@ -33,6 +33,8 @@ def technology_enable_tethering(path, tech_type, ssid, psk):
                                tech.SetProperty("Tethering", dbus.Boolean(1))
 
                                return tech_type
+                       else:
+                               return None
 
 properties = manager.GetProperties()
 
@@ -46,6 +48,8 @@ for key in properties.keys():
                                tech = technology_enable_tethering(path,
                                                        sys.argv[1], "", "")
 
+                       if tech != None:
+                               break;
 
 if tech == None:
        print "Failed to enable %s tethering" % (sys.argv[1])