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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-12-13 19:39:34 +02:00 committed by Jouni Malinen
parent 0aca60b84c
commit 3301e925b7

View 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()