It was possible for this test case to fail if P2P_FLUSH was issued
during a search scan and that scan adding back the peer. Avoid this by
forcing p2p_find to be started regardless of the current P2P peer table
contents for each round of service discovery.
Signed-hostap: Jouni Malinen <j@w1.fi>
dev[1].request("P2P_FLUSH")
dev[1].request("P2P_SERV_DISC_REQ " + dst + " " + query)
- if not dev[1].discover_peer(addr0, social=True):
+ if not dev[1].discover_peer(addr0, social=True, force_find=True):
raise Exception("Peer " + addr0 + " not found")
ev = dev[0].wait_event(["P2P-SERV-DISC-REQ"], timeout=10)
return True
return "[PROBE_REQ_ONLY]" not in res
- def discover_peer(self, peer, full=True, timeout=15, social=True):
+ def discover_peer(self, peer, full=True, timeout=15, social=True, force_find=False):
logger.info(self.ifname + ": Trying to discover peer " + peer)
- if self.peer_known(peer, full):
+ if not force_find and self.peer_known(peer, full):
return True
self.p2p_find(social)
count = 0