Some devices (e.g. bluetooth) doesn't export 'Interface' property,
test scripts would fail when trying to access the 'Interface' property
of such devices.

Signed-off-by: Zhu Yanhai <[email protected]>
---
 test/disable-device |    7 +++++--
 test/enable-device  |    7 +++++--
 test/test-connman   |    5 ++++-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/test/disable-device b/test/disable-device
index 7aadab0..8a8f2ff 100755
--- a/test/disable-device
+++ b/test/disable-device
@@ -20,8 +20,11 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
-       if properties["Interface"] != sys.argv[1]:
-               continue;
+       try:
+               if properties["Interface"] != sys.argv[1]:
+                       continue;
+       except:
+               continue
 
        print "Disabling device %s" % (path)
 
diff --git a/test/enable-device b/test/enable-device
index b5b1a9c..7b4f473 100755
--- a/test/enable-device
+++ b/test/enable-device
@@ -20,8 +20,11 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
-       if properties["Interface"] != sys.argv[1]:
-               continue;
+       try:
+               if properties["Interface"] != sys.argv[1]:
+                       continue;
+       except:
+               continue
 
        print "Enabling device %s" % (path)
 
diff --git a/test/test-connman b/test/test-connman
index f9ab201..f50e3ee 100755
--- a/test/test-connman
+++ b/test/test-connman
@@ -354,7 +354,10 @@ elif sys.argv[1] == "dev":
 
                properties = device.GetProperties()
 
-               if interface != "" and properties["Interface"] != interface:
+               try:
+                       if interface != "" and properties["Interface"] != 
interface:
+                               continue
+               except:
                        continue
 
                if command == "scan":
-- 
1.6.2.2

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to