]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: GO Negotiation and timeout while waiting for peer
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 28 Oct 2014 14:39:33 +0000 (16:39 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 29 Oct 2014 10:52:51 +0000 (12:52 +0200)
grpform_cred_ready_timeout2 is similar to the grpform_cred_ready_timeout
test case with the difference being in initiating a P2P_FIND operation
during the wait.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_p2p_grpform.py

index 13b6e4ca28a66b9cc1f2a12b813fc63f584fb267..f7313651c648d8e941f1613c9e8391c5b727e2c1 100644 (file)
@@ -725,6 +725,32 @@ def test_grpform_cred_ready_timeout(dev, apdev, params):
     if end - start < 120:
         raise Exception("Too short GO Negotiation wait time: {}".format(end - start))
 
+def test_grpform_cred_ready_timeout2(dev, apdev, params):
+    """P2P GO Negotiation wait for credentials to become ready (2) [long]"""
+    if not params['long']:
+        logger.info("Skip test case with long duration due to --long not specified")
+        return "skip"
+
+    dev[1].p2p_listen()
+    addr1 = dev[1].p2p_dev_addr()
+    if not dev[0].discover_peer(addr1):
+        raise Exception("Peer " + addr1 + " not found")
+    start = os.times()[4]
+    if "OK" not in dev[0].global_request("P2P_CONNECT " + addr1 + " 12345670 display"):
+        raise Exception("Failed to initiate GO Neg")
+    ev = dev[0].wait_global_event(["P2P-GO-NEG-FAILURE"], timeout=30)
+    if ev is not None:
+        raise Exception("Too early GO Negotiation timeout reported")
+    logger.info("Starting p2p_find to change state")
+    dev[0].p2p_find()
+    ev = dev[0].wait_global_event(["P2P-GO-NEG-FAILURE"], timeout=100)
+    if ev is None:
+        raise Exception("GO Negotiation failure timed out")
+    end = os.times()[4]
+    logger.info("GO Negotiation wait time: {} seconds".format(end - start))
+    if end - start < 120:
+        raise Exception("Too short GO Negotiation wait time: {}".format(end - start))
+
 def test_grpform_no_wsc_done(dev):
     """P2P group formation with WSC-Done not sent"""
     addr0 = dev[0].p2p_dev_addr()