From: Jouni Malinen Date: Sat, 25 Oct 2014 18:26:23 +0000 (+0300) Subject: tests: Group formation wait for peer with driver increasing ROC duration X-Git-Tag: hostap_2_4~1237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42a4ba2865e5dd6ab151abea93474f4697dec7ab;p=thirdparty%2Fhostap.git tests: Group formation wait for peer with driver increasing ROC duration Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py index 36a9e826e..13b6e4ca2 100644 --- a/tests/hwsim/test_p2p_grpform.py +++ b/tests/hwsim/test_p2p_grpform.py @@ -769,3 +769,25 @@ def test_grpform_no_wsc_done(dev): if ev is None: raise Exception("Group formation timed out on P2P Client") dev[0].remove_group() + +def test_grpform_wait_peer(dev): + """P2P group formation wait for peer to become ready""" + addr0 = dev[0].p2p_dev_addr() + addr1 = dev[1].p2p_dev_addr() + dev[1].p2p_listen() + if not dev[0].discover_peer(addr1): + raise Exception("Peer " + addr1 + " not found") + dev[0].request("SET extra_roc_dur 500") + if "OK" not in dev[0].request("P2P_CONNECT " + addr1 + " 12345670 display go_intent=15"): + raise Exception("Failed to initiate GO Neg") + time.sleep(3) + dev[1].request("P2P_CONNECT " + addr0 + " 12345670 enter go_intent=0") + + ev = dev[0].wait_global_event(["P2P-GROUP-STARTED"], timeout=15) + if ev is None: + raise Exception("Group formation timed out") + dev[0].request("SET extra_roc_dur 0") + ev = dev[1].wait_global_event(["P2P-GROUP-STARTED"], timeout=15) + if ev is None: + raise Exception("Group formation timed out") + dev[0].remove_group()