From a1a60635a8a94f9278e87b95b98279cb1af2c967 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 10 Dec 2016 00:33:33 +0200 Subject: [PATCH] tests: Make p2ps_wildcard_p2ps more robust The final check in this test case was issuing a new P2P_FIND command immediately after the P2P_SERVICE_DEL command on the peer. It looked like it was possible for the scan timing to go in a sequence that made the new P2P_FIND operation eventually accept a cfg80211 BSS entry from the very end of the previous P2P_FIND. This resulted in unexpected P2P-DEVICE-FOUND event even though there was no new Probe Response frame from the peer at that point in time. Make this less likely to show unrelated failures by waiting a bit before starting a new P2P_FIND operation after having changes peer configuration. Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2ps.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/hwsim/test_p2ps.py b/tests/hwsim/test_p2ps.py index 4ae086878..075e440f7 100644 --- a/tests/hwsim/test_p2ps.py +++ b/tests/hwsim/test_p2ps.py @@ -995,6 +995,8 @@ def test_p2ps_wildcard_p2ps(dev): if res is None: raise Exception("Unable to remove the advertisement instance 2") + dev[1].p2p_stop_find() + time.sleep(0.1) if "OK" not in dev[1].global_request("P2P_FIND 10 type=social seek=" + p2ps_wildcard): raise Exception("Failed on P2P_FIND command")