tests: D-Bus DeviceFoundProperties signal
authorJouni Malinen <j@w1.fi>
Fri, 24 Jun 2016 15:38:36 +0000 (18:38 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 24 Jun 2016 16:02:59 +0000 (19:02 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_dbus.py

index 416dd27..11d8f8d 100644 (file)
@@ -2727,6 +2727,7 @@ def test_dbus_p2p_discovery(dev, apdev):
             TestDbus.__init__(self, bus)
             self.found = False
             self.found2 = False
+            self.found_prop = False
             self.lost = False
             self.find_stopped = False
 
@@ -2735,6 +2736,8 @@ def test_dbus_p2p_discovery(dev, apdev):
             gobject.timeout_add(15000, self.timeout)
             self.add_signal(self.deviceFound, WPAS_DBUS_IFACE_P2PDEVICE,
                             "DeviceFound")
+            self.add_signal(self.deviceFoundProperties,
+                            WPAS_DBUS_IFACE_P2PDEVICE, "DeviceFoundProperties")
             self.add_signal(self.deviceLost, WPAS_DBUS_IFACE_P2PDEVICE,
                             "DeviceLost")
             self.add_signal(self.provisionDiscoveryResponseEnterPin,
@@ -2802,6 +2805,12 @@ def test_dbus_p2p_discovery(dev, apdev):
                     raise Exception("Unexpected error message for invalid RejectPeer(): " + str(e))
             self.loop.quit()
 
+        def deviceFoundProperties(self, path, properties):
+            logger.debug("deviceFoundProperties: path=%s" % path)
+            logger.debug("peer properties: " + str(properties))
+            if properties['DeviceAddress'] == a1:
+                self.found_prop = True
+
         def provisionDiscoveryResponseEnterPin(self, peer_object):
             logger.debug("provisionDiscoveryResponseEnterPin - peer=%s" % peer_object)
             p2p.Flush()