Browse Source

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>
Jouni Malinen 8 years ago
parent
commit
0a425e0f04
1 changed files with 9 additions and 1 deletions
  1. 9 1
      tests/hwsim/test_p2p_ext.py

+ 9 - 1
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"):
     if "OK" not in dev[0].request("VENDOR_ELEM_ADD 8 dd050011223305"):
         raise Exception("VENDOR_ELEM_ADD failed")
         raise Exception("VENDOR_ELEM_ADD failed")
     dev[0].p2p_listen()
     dev[0].p2p_listen()
-    dev[1].p2p_listen()
     dev[1].p2p_go_neg_auth(addr0, "12345670", "enter")
     dev[1].p2p_go_neg_auth(addr0, "12345670", "enter")
+    dev[1].p2p_listen()
     dev[0].p2p_go_neg_init(addr1, "12345678", "display")
     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].p2p_go_neg_auth_result(expect_failure=True)
+    dev[1].dump_monitor()
 
 
     out = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"),
     out = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"),
                      "wifi_p2p.public_action.subtype == 2")
                      "wifi_p2p.public_action.subtype == 2")