From 845d48c133acd0cad54bd99dda1541e76d41224f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 22 Nov 2015 21:28:49 +0200 Subject: [PATCH] tests: Make dbus_p2p_group_idle_timeout more robust This test case was failing if a PropertiesChanged signal for P2P peer gets delivered from a previous test case. Avoid that by waiting for the new group to be formed before processing any PropertiesChanged signals. This failure was triggered by the following test case sequence: dbus_p2p_two_groups dbus_p2p_group_idle_timeout Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index 32d270353..a85c33c8f 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -4411,6 +4411,7 @@ def _test_dbus_p2p_group_idle_timeout(dev, apdev): def __init__(self, bus): TestDbus.__init__(self, bus) self.done = False + self.group_started = False self.peer_group_added = False self.peer_group_removed = False @@ -4453,6 +4454,7 @@ def _test_dbus_p2p_group_idle_timeout(dev, apdev): def groupStarted(self, properties): logger.debug("groupStarted: " + str(properties)) + self.group_started = True g_if_obj = bus.get_object(WPAS_DBUS_SERVICE, properties['interface_object']) dev1 = WpaSupplicant('wlan1', '/tmp/wpas-wlan1') @@ -4473,6 +4475,8 @@ def _test_dbus_p2p_group_idle_timeout(dev, apdev): logger.debug("propertiesChanged: interface_name=%s changed_properties=%s invalidated_properties=%s" % (interface_name, str(changed_properties), str(invalidated_properties))) if interface_name != WPAS_DBUS_P2P_PEER: return + if not self.group_started: + return if "Groups" not in changed_properties: return if len(changed_properties["Groups"]) > 0: