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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-12-14 16:32:05 +02:00 committed by Jouni Malinen
parent bb5d761c2e
commit 0a425e0f04

View file

@ -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")