From 3301e925b7501c9ebf7c41cf9c72b1cecf9a9d07 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 13 Dec 2016 19:39:34 +0200 Subject: [PATCH] tests: Make dbus_p2p_go_neg_init more robust It was apparently possible to get a propertiesChanged event from an earlier test case with an empty Groups property. That ended up this case exiting immediately before running through the steps and consequently, failing due to missed operations. Make this less likely to happen by accepting the Groups property emptying event only after a group has been added for a peer first. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index cce0695c9..7233a6da5 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -4333,6 +4333,11 @@ def test_dbus_p2p_go_neg_init(dev, apdev): if len(changed_properties["Groups"]) > 0: self.peer_group_added = True if len(changed_properties["Groups"]) == 0: + if not self.peer_group_added: + # This is likely a leftover event from an earlier test case, + # ignore it to allow this test case to go through its steps. + logger.info("Ignore propertiesChanged indicating group removal before group has been added") + return self.peer_group_removed = True self.loop.quit()