]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Force p2p_find in p2p_service_discovery_fragmentation
authorJouni Malinen <j@w1.fi>
Sun, 5 Jan 2014 14:42:48 +0000 (16:42 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:11 +0000 (10:45 +0200)
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>

tests/hwsim/test_p2p_service.py
tests/hwsim/wpasupplicant.py

index 8faefdc869a5c723b03aa5f23881f452246cd495..6c936f47b6469e687d7adf9dfd22dea0a8f67321 100644 (file)
@@ -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)
index 8c46eeeb9db52ad5481940b46e56407e8c686248..399aebd924d9168b72a88cb6691df3125c291913 100644 (file)
@@ -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