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