mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
tests: D-Bus GroupFormationFailure signal
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
2a95fac944
commit
084780f1ca
@ -4403,7 +4403,8 @@ def test_dbus_p2p_wps_failure(dev, apdev):
|
|||||||
class TestDbusP2p(TestDbus):
|
class TestDbusP2p(TestDbus):
|
||||||
def __init__(self, bus):
|
def __init__(self, bus):
|
||||||
TestDbus.__init__(self, bus)
|
TestDbus.__init__(self, bus)
|
||||||
self.done = False
|
self.wps_failed = False
|
||||||
|
self.formation_failure = False
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
gobject.timeout_add(1, self.run_test)
|
gobject.timeout_add(1, self.run_test)
|
||||||
@ -4420,6 +4421,9 @@ def test_dbus_p2p_wps_failure(dev, apdev):
|
|||||||
"GroupStarted")
|
"GroupStarted")
|
||||||
self.add_signal(self.wpsFailed, WPAS_DBUS_IFACE_P2PDEVICE,
|
self.add_signal(self.wpsFailed, WPAS_DBUS_IFACE_P2PDEVICE,
|
||||||
"WpsFailed")
|
"WpsFailed")
|
||||||
|
self.add_signal(self.groupFormationFailure,
|
||||||
|
WPAS_DBUS_IFACE_P2PDEVICE,
|
||||||
|
"GroupFormationFailure")
|
||||||
self.loop.run()
|
self.loop.run()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@ -4440,8 +4444,15 @@ def test_dbus_p2p_wps_failure(dev, apdev):
|
|||||||
|
|
||||||
def wpsFailed(self, name, args):
|
def wpsFailed(self, name, args):
|
||||||
logger.debug("wpsFailed - name=%s args=%s" % (name, str(args)))
|
logger.debug("wpsFailed - name=%s args=%s" % (name, str(args)))
|
||||||
self.done = True
|
self.wps_failed = True
|
||||||
self.loop.quit()
|
if self.formation_failure:
|
||||||
|
self.loop.quit()
|
||||||
|
|
||||||
|
def groupFormationFailure(self, reason):
|
||||||
|
logger.debug("groupFormationFailure - reason=%s" % reason)
|
||||||
|
self.formation_failure = True
|
||||||
|
if self.wps_failed:
|
||||||
|
self.loop.quit()
|
||||||
|
|
||||||
def run_test(self, *args):
|
def run_test(self, *args):
|
||||||
logger.debug("run_test")
|
logger.debug("run_test")
|
||||||
@ -4453,7 +4464,7 @@ def test_dbus_p2p_wps_failure(dev, apdev):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def success(self):
|
def success(self):
|
||||||
return self.done
|
return self.wps_failed and self.formation_failure
|
||||||
|
|
||||||
with TestDbusP2p(bus) as t:
|
with TestDbusP2p(bus) as t:
|
||||||
if not t.success():
|
if not t.success():
|
||||||
|
Loading…
Reference in New Issue
Block a user