diff --git a/tests/hwsim/test_p2p_service.py b/tests/hwsim/test_p2p_service.py index 8faefdc86..6c936f47b 100644 --- a/tests/hwsim/test_p2p_service.py +++ b/tests/hwsim/test_p2p_service.py @@ -40,7 +40,7 @@ def run_sd(dev, dst, query, exp_query=None, fragment=False): 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) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 8c46eeeb9..399aebd92 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -299,9 +299,9 @@ class WpaSupplicant: 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