From 42a4ba2865e5dd6ab151abea93474f4697dec7ab Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 25 Oct 2014 21:26:23 +0300 Subject: [PATCH] tests: Group formation wait for peer with driver increasing ROC duration Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_grpform.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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()