]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use longer timeout in p2p_go_neg_auth_result()
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 14 Dec 2016 10:45:37 +0000 (12:45 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 14 Dec 2016 10:45:37 +0000 (12:45 +0200)
It is possible for the P2P-GROUP-STARTED event to get delayed more than
one second especially when the GO Negotiation responder becomes the P2P
Client and the system is heavily loaded. Increase the default timeout
for the expected success case from 1 to 5 seconds to avoid failing test
cases that would have succeeded if given a bit more time to complete the
exchange.

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

index 73046e61ee73209aad47fcfc67ece8c02357c3b1..5247829f3043d1ec3b0fb1b055c793fb5c40d372 100644 (file)
@@ -682,7 +682,9 @@ class WpaSupplicant:
             return None
         raise Exception("P2P_CONNECT (auth) failed")
 
-    def p2p_go_neg_auth_result(self, timeout=1, expect_failure=False):
+    def p2p_go_neg_auth_result(self, timeout=None, expect_failure=False):
+        if timeout is None:
+            timeout = 1 if expect_failure else 5
         go_neg_res = None
         ev = self.wait_global_event(["P2P-GO-NEG-SUCCESS",
                                      "P2P-GO-NEG-FAILURE"], timeout)