From 0a425e0f04d067b9fa4c3c7fb18d89e2c0972e46 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 14 Dec 2016 16:32:05 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_p2p_ext.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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")