]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make dbus_p2p_go_neg_init more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 13 Dec 2016 17:39:34 +0000 (19:39 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 13 Dec 2016 18:07:52 +0000 (20:07 +0200)
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 <jouni@qca.qualcomm.com>
tests/hwsim/test_dbus.py

index cce0695c9dc01e07938ffd2d857eab808ea85778..7233a6da516805f0c49eec6d5317398042057e2b 100644 (file)
@@ -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()