summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-07-03 16:32:55 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2014-07-03 17:51:14 +0300
commite6099e4536e1d4b2d594ea6ec062f670dfdeef1e (patch)
treea1ad8d7d71da5fc652695825ec2f2d1cdeb64d9f /test
parentafb9c8ffe09b34625f96e88589875c2ed4a2a4e8 (diff)
downloadbluez-e6099e4536e1d4b2d594ea6ec062f670dfdeef1e.tar.gz
test: Fix getting devices in health test scripts
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-health12
-rwxr-xr-xtest/test-health-sink12
2 files changed, 22 insertions, 2 deletions
diff --git a/test/test-health b/test/test-health
index 343f29c03..24afa799e 100755
--- a/test/test-health
+++ b/test/test-health
@@ -170,7 +170,17 @@ while select == None:
adapter = dbus.Interface(bus.get_object(BUS_NAME, select), ADAPTER_INTERFACE)
-devices = adapter.GetProperties()["Devices"]
+devices = []
+for path, interfaces in objects.iteritems():
+ if "org.bluez.Device1" not in interfaces:
+ continue
+ properties = interfaces["org.bluez.Device1"]
+ if properties["Adapter"] != select:
+ continue;
+
+ if HEALTH_DEVICE_INTERFACE not in interfaces:
+ continue
+ devices.append(path)
if len(devices) == 0:
print("No devices available")
diff --git a/test/test-health-sink b/test/test-health-sink
index 52be53512..2343a23cf 100755
--- a/test/test-health-sink
+++ b/test/test-health-sink
@@ -61,7 +61,17 @@ while select == None:
adapter = dbus.Interface(bus.get_object(BUS_NAME, select),
ADAPTER_INTERFACE)
-devices = adapter.GetProperties()["Devices"]
+devices = []
+for path, interfaces in objects.iteritems():
+ if "org.bluez.Device1" not in interfaces:
+ continue
+ properties = interfaces["org.bluez.Device1"]
+ if properties["Adapter"] != select:
+ continue;
+
+ if HEALTH_DEVICE_INTERFACE not in interfaces:
+ continue
+ devices.append(path)
if len(devices) == 0:
print("No devices available")