]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make p2p_ext_vendor_elem_go_neg_conf more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 14 Dec 2016 14:32:05 +0000 (16:32 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 14 Dec 2016 14:33:19 +0000 (16:33 +0200)
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>
tests/hwsim/test_p2p_ext.py

index 82b7658a0daf5217a375987dd82fde21ad52bca2..b38a94ba34ad98ab16b84c56abb86cb39fab21c7 100644 (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")