tests: D-Bus FindStopped signal
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
7b642dc80b
commit
571a1af270
1 changed files with 8 additions and 1 deletions
|
@ -2561,6 +2561,7 @@ def test_dbus_p2p_discovery(dev, apdev):
|
||||||
self.found = False
|
self.found = False
|
||||||
self.found2 = False
|
self.found2 = False
|
||||||
self.lost = False
|
self.lost = False
|
||||||
|
self.find_stopped = False
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
gobject.timeout_add(1, self.run_test)
|
gobject.timeout_add(1, self.run_test)
|
||||||
|
@ -2572,6 +2573,8 @@ def test_dbus_p2p_discovery(dev, apdev):
|
||||||
self.add_signal(self.provisionDiscoveryResponseEnterPin,
|
self.add_signal(self.provisionDiscoveryResponseEnterPin,
|
||||||
WPAS_DBUS_IFACE_P2PDEVICE,
|
WPAS_DBUS_IFACE_P2PDEVICE,
|
||||||
"ProvisionDiscoveryResponseEnterPin")
|
"ProvisionDiscoveryResponseEnterPin")
|
||||||
|
self.add_signal(self.findStopped, WPAS_DBUS_IFACE_P2PDEVICE,
|
||||||
|
"FindStopped")
|
||||||
self.loop.run()
|
self.loop.run()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -2636,6 +2639,10 @@ def test_dbus_p2p_discovery(dev, apdev):
|
||||||
logger.debug("provisionDiscoveryResponseEnterPin - peer=%s" % peer_object)
|
logger.debug("provisionDiscoveryResponseEnterPin - peer=%s" % peer_object)
|
||||||
p2p.Flush()
|
p2p.Flush()
|
||||||
|
|
||||||
|
def findStopped(self):
|
||||||
|
logger.debug("findStopped")
|
||||||
|
self.find_stopped = True
|
||||||
|
|
||||||
def run_test(self, *args):
|
def run_test(self, *args):
|
||||||
logger.debug("run_test")
|
logger.debug("run_test")
|
||||||
p2p.Find(dbus.Dictionary({'DiscoveryType': 'social',
|
p2p.Find(dbus.Dictionary({'DiscoveryType': 'social',
|
||||||
|
@ -2643,7 +2650,7 @@ def test_dbus_p2p_discovery(dev, apdev):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def success(self):
|
def success(self):
|
||||||
return self.found and self.lost and self.found2
|
return self.found and self.lost and self.found2 and self.find_stopped
|
||||||
|
|
||||||
with TestDbusP2p(bus) as t:
|
with TestDbusP2p(bus) as t:
|
||||||
if not t.success():
|
if not t.success():
|
||||||
|
|
Loading…
Reference in a new issue