From d7fb9e481975c489a90f1ba1d39a81a3d30a9977 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 15 Apr 2014 00:53:30 +0300 Subject: [PATCH] tests: Fix progressive p2p_find to actually use progressive part It turned out that the initial test case found the GO based on the initial full scan instead of the progressive search part. Fix this by started the GO only after the initial full scan. Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_discovery.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py index ed730222c..c159aad24 100644 --- a/tests/hwsim/test_p2p_discovery.py +++ b/tests/hwsim/test_p2p_discovery.py @@ -213,17 +213,22 @@ def test_discovery_dev_id_go(dev): def test_discovery_social_plus_one(dev): """P2P device discovery with social-plus-one""" logger.info("Start autonomous GO " + dev[0].ifname) - dev[2].p2p_start_go(freq="2422") - go = dev[2].p2p_dev_addr() dev[1].p2p_find(social=True) dev[0].p2p_find(progressive=True) - ev = dev[0].wait_event(["P2P-DEVICE-FOUND"]) + logger.info("Wait for initial progressive find phases") + dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"]) + dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"]) + go = dev[2].p2p_dev_addr() + dev[2].p2p_start_go(freq="2422") + logger.info("Verify whether the GO on non-social channel can be found") + ev = dev[0].wait_global_event(["P2P-DEVICE-FOUND"], timeout=15) if ev is None: raise Exception("Peer not found") - ev = dev[0].wait_event(["P2P-DEVICE-FOUND"]) - if ev is None: - raise Exception("Peer not found") - ev = dev[1].wait_event(["P2P-DEVICE-FOUND"]) + if go not in ev: + ev = dev[0].wait_global_event(["P2P-DEVICE-FOUND"], timeout=15) + if ev is None: + raise Exception("Peer not found") + ev = dev[1].wait_global_event(["P2P-DEVICE-FOUND"], timeout=15) if ev is None: raise Exception("Peer not found") dev[0].p2p_stop_find()