From: Jouni Malinen Date: Sun, 5 Jan 2014 14:42:48 +0000 (+0200) Subject: tests: Force p2p_find in p2p_service_discovery_fragmentation X-Git-Tag: hostap_2_1~183 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d4b21766e592ed3deafa67c446522419542108ca;p=thirdparty%2Fhostap.git tests: Force p2p_find in p2p_service_discovery_fragmentation 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 --- 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