From: Jouni Malinen Date: Wed, 14 Dec 2016 14:32:05 +0000 (+0200) Subject: tests: Make p2p_ext_vendor_elem_go_neg_conf more robust X-Git-Tag: hostap_2_7~2011 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a425e0f04d067b9fa4c3c7fb18d89e2c0972e46;p=thirdparty%2Fhostap.git tests: Make p2p_ext_vendor_elem_go_neg_conf more robust Use P2P listen mode on dev[1] to speed up GO Negotiation and explicitly wait for successfully completed GO Negotiation to make the failure cases clearer. Previously, it was possible for the GO Negotiation to fail and execution to go to the tshark check even when no GO Negotiation Confirm frame was sent. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_p2p_ext.py b/tests/hwsim/test_p2p_ext.py index 82b7658a0..b38a94ba3 100644 --- a/tests/hwsim/test_p2p_ext.py +++ b/tests/hwsim/test_p2p_ext.py @@ -258,10 +258,18 @@ def _test_p2p_ext_vendor_elem_go_neg_conf(dev, apdev, params): if "OK" not in dev[0].request("VENDOR_ELEM_ADD 8 dd050011223305"): raise Exception("VENDOR_ELEM_ADD failed") dev[0].p2p_listen() - dev[1].p2p_listen() dev[1].p2p_go_neg_auth(addr0, "12345670", "enter") + dev[1].p2p_listen() dev[0].p2p_go_neg_init(addr1, "12345678", "display") + ev = dev[0].wait_global_event(["P2P-GO-NEG-SUCCESS"], timeout=15) + if ev is None: + raise Exception("GO negotiation timed out") + ev = dev[0].wait_global_event(["P2P-GROUP-FORMATION-FAILURE"], timeout=15) + if ev is None: + raise Exception("Group formation failure not indicated") + dev[0].dump_monitor() dev[1].p2p_go_neg_auth_result(expect_failure=True) + dev[1].dump_monitor() out = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"), "wifi_p2p.public_action.subtype == 2")